I have a matrix (57,3600,45), how can I create matrices with (3600,45)?

1 visualización (últimos 30 días)
Jose Martin
Jose Martin el 15 de Feb. de 2019
Comentada: dpb el 19 de Feb. de 2019
i have some testing data (57 test) compile into a matrix (57,3600,45) with 45 different column and 3600 rows of data.
i would like to look independenly different test into plots. i wouls like to get matrices shape to (3600,45)
thank you for any help

Respuestas (3)

James Tursa
James Tursa el 15 de Feb. de 2019
Is this what you want?
k = some integer index
squeeze(your_matrix(k,:,:))

Kevin Phung
Kevin Phung el 15 de Feb. de 2019
does this give you what you want?
test_num = 1;
M(test_num,:,:) %where M= your matrix

dpb
dpb el 15 de Feb. de 2019
Why did you store data in such a permuted order?
However, not to fear, MATLAB can fix your problem!
data=permute(data,[2 3 1]); % rearrange to place 2D arrays by plane
Now you can iterate over the 57 planes and retrieve each test set as
tst=data(:,:,i);
and process each as desired.
  2 comentarios
dpb
dpb el 19 de Feb. de 2019
JM Answer moved to comment...dpb
Thank you for all the answer...
I only get a matrix where all the (3600,54) are 1
i stored the data in this way becouse it would make simplier to add more test and how to look the data... at least in my mind...
Thank you,
dpb
dpb el 19 de Feb. de 2019
Well, presuming all you did was the permute operation, then that's what the data in the array are...all permute does is change the order of the indices
You could make life much easier for yourself if you would store the data in 3D array by plane for each test initially. If it (the test data) are a 2D array for each test, then treating each test as a layer in a stack would seem the easiest by far both to look at and to process.

Iniciar sesión para comentar.

Categorías

Más información sobre Logical en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by