plot 3D

1 回表示 (過去 30 日間)
George
George 2011 年 6 月 14 日
コメント済み: Walter Roberson 2021 年 4 月 5 日
hi there. let's say that i have 3 matrixes. A=[1:10], B=[1:10] and C=[1:10]. I also have a time line. tim=1:1/2:10 . Let's say that if you plot these matrixes with tim you can see how a particle is moving. (assuming that the 3 matrixes describes the movement of a particle). Can i do this in 3D ? for the different times to see where is the particle ? Thanks

回答 (3 件)

Walter Roberson
Walter Roberson 2011 年 6 月 14 日
There is plot3d(x,y,z). However, you are requesting a 4 dimensional plot (3 coordinates plus time), and there are no 4 dimensional plotting routines.
I note your tim vector has twice the number of values that A, B, and C does, and that confuses me as to what you want. If all of them were the same length, I would expect that you meant that the particle had position [A(K), B(K), C(K)] at time tim(K)
In order to display 4 dimensions of data simultaneously, you will need to encode one of the dimensions as either color or transparency. Color is easier.
I suggest that as a first approximation, you consider using scatter3(), coding the spacial dimension as X Y Z, and coding the time in either the color or dot-size parameter.
  2 件のコメント
George
George 2011 年 6 月 15 日
Can you make me a simple example, please? Assume that tim is 1:10 like the matrixes!
Walter Roberson
Walter Roberson 2011 年 6 月 15 日
spotsize = 8;
scatter3(A, B, C, spotsize, tim);

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


Teja Muppirala
Teja Muppirala 2011 年 6 月 15 日
A = interpft(rand(1,10),1001);
B = interpft(rand(1,10),1001);
C = interpft(rand(1,10),1001);
t = 0:0.001:1;
figure
h = plot3(nan,nan,nan,'ro');
axis equal vis3d
box on
for n = 1:numel(t)
set(h,{'Xdata','Ydata','Zdata'},{A(n) B(n) C(n)});
title(t(n));
drawnow;
end

Santhiya Santhiya
Santhiya Santhiya 2021 年 4 月 5 日
Is this correct
  1 件のコメント
Walter Roberson
Walter Roberson 2021 年 4 月 5 日
Is what correct?

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

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by