graphing the paths of multiple particles in the same 3d cube?

1 Ansicht (letzte 30 Tage)
cgo
cgo am 7 Jun. 2017
Kommentiert: cgo am 7 Jun. 2017
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

Antworten (2)

Jan
Jan am 7 Jun. 2017
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 Kommentare
Jan
Jan am 7 Jun. 2017
@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?
cgo
cgo am 7 Jun. 2017
My data is A, 6x6 matrix. I want to graph A(t,1) for all t. That is the first graph. Then A(t,2) for all t, this is the second. In effect, I will be seeing 6 'curves' where the x-axis is t, y-axis are the values of A and z-axis will be from 1 to 6.
Thank you for your time

Melden Sie sich an, um zu kommentieren.


Walter Roberson
Walter Roberson am 7 Jun. 2017
waterfall()

Kategorien

Mehr zu Graph and Network Algorithms finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by