best way to evaluate a 2d function composed by a summation of functions
1 次查看(过去 30 天)
显示 更早的评论
I need to plot this function:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/224941/image.png)
where c is a vector of constants, and each Φ function is a polynomial expasion of the 4+i or 4+j order.
At the moment the functions are saved in two struct (dimensions 1xN and 1xM) such that in each dimention of one structure I have the function handle reletated to the x or the y coordinate.
I'm using the following lines to compute and to plot w :
%...
x = linspace(0,xmax,Nox);
y = linspace(0,ymax,Noy);
W = zeros(Nox,Noy);
for i = 1:N
for j = 1:M
W = W + c(i*j)*(trialx(i).PHI(x))'*(trialy(j).PHI(y));
end
end
figure('Name','Displacement field','NumberTitle','off');
surf(x,y,W','EdgeColor','none'); daspect([100000 100000 1]);
xlabel('x [mm]','Fontsize',16); ylabel('y [mm]','Fontsize',16)
zlabel('y [mm]','Fontsize',16)
All the code is implemented with the symbolic toolbox and I'm struggling to plot w(x,y) with fsurf because I'm not able to write the correct summation of functions.
I need to raise the number of samples, N and M and it is quite slow;
Do you have any suggestions?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!