How to make 3D Plots in Matlab if I have data of x, y, z ?

4 ビュー (過去 30 日間)
Jomnang Piwasin
Jomnang Piwasin 2023 年 1 月 30 日
回答済み: Daksh 2023 年 2 月 3 日
How to make 3D Plots in Matlab if I have data of x, y, z ?
I have file data of x, y, z and I want to use this data to make 3D Plots. Then I try to use "vq = griddata(x,y,z,v,xq,yq,zq)" but i don't know how to set 'v' veriable and how to define a regular grid '[xq,yq,zq] = meshgrid(..?..)'. When I try to set v and set [xq,yq,zq] same like example but it's error
  2 件のコメント
Dyuman Joshi
Dyuman Joshi 2023 年 1 月 30 日
Why not use plot3 directly?
plot3(x,y,z)
Steven Lord
Steven Lord 2023 年 1 月 30 日
When I try to set v and set [xq,yq,zq] same like example but it's error
Please show us your code and the full and exact text of the messages you receive when you run your code (all the text displayed in orange and/or red in the Command Window.) The messages may be useful in determining what's going on and how to avoid the warning and/or error.

サインインしてコメントする。

回答 (1 件)

Daksh
Daksh 2023 年 2 月 3 日
I understand that you wish to make 3D plots in MATLAB with given X,Y and Z dimensional data.
Kindly refer to the MATLAB documentation for plot3() using this link:
plot3(X,Y,Z) line plots coordinates in 3-D space.
  • To plot a set of coordinates connected by line segments, specify X, Y, and Z as vectors of the same length.
for example:
x = 0:pi/50:10*pi;
y = sin(x);
z = cos(x);
plot3(z,y,x)
Hope this helps!

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by