How to Correctly Implement Nested Loops for Surface Plotting in MATLAB?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
physicsCU
Messages
198
Reaction score
1
Hey guys,

Is there anyone good with MATLAB for loops? I am having trouble with getting an embedded loop within another loop to work.

I am trying to vary two parameters and create a surface plot with a third variable as the dependent.

What I really need help with is how to get the LHS of my statements correct. I will post my code later tonight, its on another computer, but if anyone has a good site to help me out in the mean time, that would be great.

Thanks!
 
Physics news on Phys.org
Er, what error are you getting?
 
Its not an error perse, its just that i get a line in 3d space, when i should be getting a surface plot, because two variables are being varied at all points.