Here are two file
The equations are same but the surf plot is different.
Can you explain the plot process between them?
- I can understand meshgrid method.
But I can't understand the second method.
[first - meshgrid]
clear;
close all;
clc;
x=[0:0.1:2*pi];
y=x;
[X,Y] = meshgrid(x,y);
z=sin(X).*cos(Y);
figure(1);
s=surf(X, Y, z);
[second - without meshgrid] - This is in the help manual at surf command
clear;
close all;
clc;
a=[0:0.1:2*pi];
b=a;
c=sin(a')*cos(b);
% z=sin(x)*cos(y); 이렇게 하면 error 난다, size 정보가 맞아아 그래프가 그려짐
% sin cos 의 결과가 행렬의 곱셈이기에
figure(2);
s=surf(a, b, c);