How to decompose 3d array to 3 matrices
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi every one
i have a 3d array with dimension 51*71*3 and i want to obtain column vector 153*1
d=(51*71*3)
n=d(:,:,1) so now 51*71
r=d(:,:,2) becomes 51*71
c=data(:,3) becomes51*71
so now b=[n;r;c] 153*71
but i need153*1 instead
how can i obtain this vector
thanks in advance
댓글 수: 0
답변 (1개)
Jan
2021년 10월 25일
x = rand(51, 71, 3);
v = reshape(x(:, 27, :), [], 1);
size(v)
댓글 수: 2
James Tursa
2021년 10월 25일
편집: James Tursa
2021년 10월 25일
@RADWAN A F ZEYADI The random vector was just to generate sample data of the same size as your problem. Jan is not suggesting that you need to use rand( ) in your code. E.g., using your d variable:
v = reshape(d(:, 27, :), [], 1);
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!