MATLAB: Help with MESH command

mesh

Im trying to write a space with this equations, but i donĀ“t know how to use mesh properly. Please for little help, im new in matlab.
r=linspace(0,1,30)
theta=linspace(0,2*pi,30)
x=r.*cos(theta)
y=r.*sin(theta)
z=r

Best Answer

Did you mean something like this?
[r,theta] = meshgrid(linspace(0,1,30),linspace(0,2*pi,30));
x = r.*cos(theta);
y = r.*sin(theta);
z = r;
mesh(x,y,z)
Related Question