graphing the paths of multiple particles in the same 3d cube?
1 回表示 (過去 30 日間)
古いコメントを表示
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164948/image.png)
Hi,
I would like to graph the paths of different particles under the same coordinates. The graph would look like this, how do I do this?
Thanks
0 件のコメント
回答 (2 件)
Jan
2017 年 6 月 7 日
data = rand(20, 20) + 1:20; % Matlab >= 2016b, or bsxfun(@plus, rand(20, 20), 1:20)
plot3(data, 1:20, 1:20);
view(3)
3 件のコメント
Jan
2017 年 6 月 7 日
@cgo: You can use the plot3() command as shown to draw lines in 3D. Define the X, Y and Z coordinates accordingly to get the wanted "stacked 2D lines".
You can draw the lines in a loop also:
axes('NextPlot', 'add');
for k = 1:10
plot3(1:20, repmat(k, 1, 20), k+(1:20) + rand(1, 20))
end
What is "crossover to z"? I assume that this depends on your data, but I did only demonstrate, what was asked in the question: How to draw such a diagram. I do not know your data.
What is your question exactly?
参考
カテゴリ
Help Center および 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!