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

1 vue (au cours des 30 derniers jours)
Jose Martin
Jose Martin le 15 Fév 2019
Commenté : dpb le 19 Fév 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

Réponses (3)

James Tursa
James Tursa le 15 Fév 2019
Is this what you want?
k = some integer index
squeeze(your_matrix(k,:,:))

Kevin Phung
Kevin Phung le 15 Fév 2019
does this give you what you want?
test_num = 1;
M(test_num,:,:) %where M= your matrix

dpb
dpb le 15 Fév 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 commentaires
dpb
dpb le 19 Fév 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 le 19 Fév 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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by