If I have a 3D matrix, X
that is 4 x 10 x 50
.
The matrix consists of positions and velocities in the first dimension, different particles (or boats or whatever) indexes in the second and lastly the different time steps for the particles movement in the third. Maybe not that important but maybe it clarifies my problem.
Say I want to plot the values of X
for specific indices in the first two dimensions across the 3rd dimension
>> plot(X(1,1,:))
Error using plot
Data may not have more than 2 dimensions
Even though the values supplied are one dimensional I cant use plot here because they are given separately like this:
>> X(1,1,1:5)
ans(:,:,1) =
10
ans(:,:,2) =
11.4426
ans(:,:,3) =
12.5169
ans(:,:,4) =
13.7492
ans(:,:,5) =
14.9430
How can I convert the result of X( 1, 1, :)
into a vector?
class(X)
gives the answerdouble
– while