In a 3D plot, what are the independent and dependent variables?
10 views (last 30 days)
Show older comments
Ibrahim Omar
on 3 Feb 2018
Commented: Image Analyst
on 3 Feb 2018
When using the plot3() command, which inputs are the independent variables and which inputs are dependent variables?
0 Comments
Accepted Answer
Star Strider
on 3 Feb 2018
Edited: Star Strider
on 3 Feb 2018
The first two arguments to plot3() (usually ‘X’ and ‘Y’) are the independent variables. The third (usually ‘Z’) is the dependent variable. (This is the same for surf(), mesh(), and contour() plots.)
2 Comments
Image Analyst
on 3 Feb 2018
The key word is "usually". Sometimes that's not the case. for example sometimes I plot the vertical profile of an image (so it's "sideways" to the left of the image) where y is the row number (independent) and x is the mean gray level. So like I said below, you could have whatever you want be dependent or independent in your mind - plot3() (unlike surf) really doesn't care whatsoever what you consider to be dependent or independent. Use whatever is convenient for you for your dependent variable - the first, second, or third argument.
More Answers (1)
Image Analyst
on 3 Feb 2018
It's whatever you want. plot3() doesn't care - it simply puts a marker at every corresponding (x,y,z) location.
0 Comments
See Also
Categories
Find more on Graphics Object Properties 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!