clear alln=1;for ii = 1:10; for jj = 1:10; x(n) = ii; y(n) = jj; z(n) = ii+jj; n = n+1; endendsurf(x,y,z)
MATLAB: I am trying to create a surface plot with nested loops and am getting the error “Z must be a matrix, not a scalar or vector.”
MATLABmatrix errornested loopssurface plots
Best Answer