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

조회 수: 1 (최근 30일)
Jose Martin
Jose Martin 2019년 2월 15일
댓글: dpb 2019년 2월 19일
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

답변 (3개)

James Tursa
James Tursa 2019년 2월 15일
Is this what you want?
k = some integer index
squeeze(your_matrix(k,:,:))

Kevin Phung
Kevin Phung 2019년 2월 15일
does this give you what you want?
test_num = 1;
M(test_num,:,:) %where M= your matrix

dpb
dpb 2019년 2월 15일
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
dpb
dpb 2019년 2월 19일
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 2019년 2월 19일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by