x1=[p]y1=[vw]Z1=[v]for r=1:23 for n=1:23 if r==n z1(r,n)=Z1(r,n); else z1(r,n)=NaN; end end endz1;surf(log(x1),y1,z1)
I have x,y,z coordinates for 3D line plots. What I need to draw 3d the plane covered by that 3D lines. If I use the above format it does not do anything at all.
Then I removed the 'NaN' values from the Z matrices using below code.
%B = num2str(z1)'; % Convert numbers into strings.
I = strfind(B(:)','NaN'); % Find NaNs
B([I I+1 I+2]) = ' '; % Replace NaN with spaces
z1 = B'; % Display result
After that, it is saying,
23×313 char arrayZ must be a matrix, not a scalar or vector.Error in surf(log(x1),y1,z1)
Best Answer