I have a matrix (57,3600,45), how can I create matrices with (3600,45)?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (3개)
James Tursa
2019년 2월 15일
Is this what you want?
k = some integer index
squeeze(your_matrix(k,:,:))
댓글 수: 0
Kevin Phung
2019년 2월 15일
does this give you what you want?
test_num = 1;
M(test_num,:,:) %where M= your matrix
댓글 수: 0
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
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
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 Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!