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

AI Thread Summary
The discussion centers on troubleshooting MATLAB for loops, specifically regarding the implementation of nested loops to vary two parameters for creating a surface plot with a third dependent variable. The user is experiencing issues with the left-hand side of their statements, resulting in a line in 3D space instead of the expected surface plot. They seek assistance with their code and are open to recommendations for helpful resources while they prepare to share their code later. The problem is not an error message but rather an unexpected output, indicating a need for proper loop structure and variable handling to achieve the desired graphical representation.
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 dependant.

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.
 
Back
Top