![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174055/image.jpeg)
How to plot a 2d matrix on a 3d graph?
2 ビュー (過去 30 日間)
古いコメントを表示
Lucas Carvalho
2015 年 3 月 20 日
コメント済み: Lucas Carvalho
2015 年 3 月 20 日
Hi guys, I want to plot in 3d a matrix whose columns represent points in the space:
A = [x0 x1 x2 .... xn; y0 y1 y2 .... yn; z0 z1 z2 .... zn]
So the first point is [x0;y0;z0], the second one [x1;y1;z1], until the last n-th point. My intention is to create a trajectory between these points. I have already tried surf, mesh and other 3d plots, but none of them are doing it.
Thank you!
0 件のコメント
採用された回答
Konstantinos Sofos
2015 年 3 月 20 日
Hi,
So the problem is that you do not want to plot a matrix but the information contained in 3 vectors (which are the columns of a matrix) in 3D. Have you tried griddata?
As an example
X=rand(1,30);
Y=rand(1,30);
Z=rand(1,30);
[XI YI ZI] = griddata(X,Y,Z,linspace(0,1),linspace(0,1)');
surf(XI,YI,ZI)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174055/image.jpeg)
Regards
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!