필터 지우기
필터 지우기

Matrix Manipulation from 4D to 2D

조회 수: 3 (최근 30일)
Amine Ben Ayara
Amine Ben Ayara 2016년 12월 12일
편집: Matt J 2016년 12월 12일
Hello Matlab Community again, Back with another question. So I have this matrix that is 4D (5 by 5 by 14680 by 30); in my own simple words, 30 sets of 14680 of 5*5 matrices, The objective is to extract the 1st column from each 5*5 matrix so that's (5*1) for all the 14680 and across the 30 sets to get to a final matrix that is of dimension (73400by30) ( 73400 is =14680*5 , that is all the 5*1 arrays stacked vertically). I hope I explained this simple enough, I used both "squeeze" and "reshape" but I kept getting the wrong dimension in the end, Please help, Thank you so much

채택된 답변

Matt J
Matt J 2016년 12월 12일
편집: Matt J 2016년 12월 12일
result=reshape( A(:,1,:), [],30);
  댓글 수: 2
Amine Ben Ayara
Amine Ben Ayara 2016년 12월 12일
Hello Matt, what is the "i" indexing here? Thanks,
Matt J
Matt J 2016년 12월 12일
편집: Matt J 2016년 12월 12일
There is no longer any "i" in my solution. But if you decided you wanted a column index other than 1, you would obviously use a different index.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by