surf plot won't happen because i need a matrix?
3 views (last 30 days)
Show older comments
Tom on 12 Dec 2011
surf plot won't happen because i need a matrix? I've just introduced a new variable to my script and I tried doing it using a nested loop. Only problem is that when I tried to plot a surface graph it says I should be using a matrix - not a scalar or vector. I just added the variable G - which is angle.
Any help would be great.
Sean de Wolski on 12 Dec 2011
That is correct. Use meshgrid to generate index matrices e.g.:
[xx yy] = meshgrid(linspace(-pi,pi,10));
What you have above are three vectors (nx1 or 1xn) and it can't generate a surface of a line.
More Answers (0)
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!