- #1
jemma
- 36
- 0
I have 2 variables and data points corresponding to them and so would like to plot this (I think using the plot3 function for a 3D graph) but I'm having trouble writing my code.
Each variable ranges from 0 to 1 (in 0.1 intervals) and so this would be the x and z axis, and I have data points corresponding to each variable point in 11 by 11 matrix (which would be plotted on the y axis).
Since the data all has to be in matrices (or vectors) of the same size, I made my x and z values into matrices, and used this function:
plot3(z,y,x,'DisplayName','z,y,x');figure(gcf)
but the figure doesn't look right and I'm not sure what I'm doing wrong.
Please help!
Each variable ranges from 0 to 1 (in 0.1 intervals) and so this would be the x and z axis, and I have data points corresponding to each variable point in 11 by 11 matrix (which would be plotted on the y axis).
Since the data all has to be in matrices (or vectors) of the same size, I made my x and z values into matrices, and used this function:
plot3(z,y,x,'DisplayName','z,y,x');figure(gcf)
but the figure doesn't look right and I'm not sure what I'm doing wrong.
Please help!