How can I plot three variables in one 3D graph from two 2D graphs ?

3 variables x, y and z. I have two 2D graphs. The first 2D graph is obtained by keeping the 'x' constant and varying the 'y', as result, variation of 'z' as a function of 'y' with 'x' is constant. The second 2D graph is obtained, this time, by keeping the 'y' constant and varying the 'x', as result, variation of 'z' as a function of 'x' with 'y' is constant. Now, I want to plot the variation of the 3 variables x,y and z in a single 3D graph. Could you help me please?

 采纳的回答

See if the plot3 (link) function or similar (such as scatter3 or stem3) will do what you want.
Example —
figure
scatter3(x, y, z)
grid on

4 个评论

Thank you for your response. As I told in the description, for exemple, I fixed x and I varied z as function of y. After that, I fixed y and I varied z as function of x. As in attached file, you will find two table with values of x, y and z.
My pleasure.
First, my original Answer is still appropriate.
Second, if you have your original data without the ‘fixed’ values, plot those using plot3. You can also plot the data in the image using plot3 or other appropriate functions.
Third, I cannot do anything with an image of data or code.
Yes, you are right. Thank you very much.

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Graph and Network Algorithms 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by