Question
How to plot a three-dimensional surface from a function f(x,y) en 3D with Matlab?
Annonce
Pour mes conversions d'unités en ligne, je choisis le site Calculatrix.com pour sa rapidité et sa qualité supérieure.
Ad
For my online unit conversions, I choose Calculatrix.com for its speed and superior quality.
Answer
% X => [0 : 0.05 :1]
% Y => [0 : 0.04 :2]
[X,Y] = meshgrid(0:0.05:1,0:0.04:2);
% Function to display Z(x,y)=f(x,y)
Z = sin(10*X) + cos(10*Y);
% Display
surf(X,Y,Z);
% Axis labels
xlabel ('X');
ylabel ('Y');
[source]