How can i obtain column vector from 3d matrx
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi every one
i would like to obtain a vector with dimension 153*1 from 3d array with dimension 51*71*3 ?
thank you
댓글 수: 0
답변 (1개)
DGM
2021년 10월 30일
편집: DGM
2021년 10월 30일
Consider the example:
% create an array
s = [5 7 3];
A = reshape(1:prod(s),s)
% create a vector containing all pages in the first column
B = reshape(A(:,1,:),[],1,1)
댓글 수: 2
DGM
2021년 10월 30일
If you have a 153x1 vector, you don't have 51x71x3=10863 elements to fill that array. They've been discarded.
You can recreate the original 51x1x3 column:
% create an array
s = [5 7 3];
A = reshape(1:prod(s),s)
% create a vector containing all pages in the first column
B = reshape(A(:,1,:),[],1,1)
% recreate the 51x1x3 part of A
C = reshape(B,[],1,s(3))
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!