surf(x,y,z) produces a striat line

5 次查看(过去 30 天)
I am trying to plot a 3d image I use the following: vertex is a 3*428 array
sze=size(vertex(2)); x=vertex(1:1,:); y=vertex(2:2,:)'; z=vertex(3:3,:); s=ones(sze,sze); t=ones(sze,sze); h=ones(sze,sze); for j=1:8 for i =1:sze s=vertcat(x,x); x=s; end end for j=1:8 for i =1:sze t=vertcat(x,x); y=t; end end for j=1:8 for i =1:sze h=vertcat(x,x); z=h; end end
x=vertcat(x,x); x=x(1:428, 1:end); y=y(1:428, 1:end); z=z(1:428, 1:end); surf(x,y,z); [m,n]=size(z); C = (z(1:(m-1),1:(n-1))+z(2:m,1:(n-1))+ ... z(1:(m-1),2:n)+z(2:m,2:n))/4; surf(x,y,z,C);
It produces a strait line, and not the model I want
can you please help

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by