3d to 2d matrix
조회 수: 3 (최근 30일)
이전 댓글 표시
I need to convert this "u" 3d matrix in a 2d numerical matrix, without having to cut and paste number by number in a new one, just like the "u2" example.
Thank you for any help!
댓글 수: 0
채택된 답변
Joseph Cheng
2021년 6월 22일
take a look at the function squeeze()
for ind = 1:3
val(1,1,ind)=-ind;
end
disp(val)
u2 = squeeze(val);
disp(u2)
댓글 수: 2
Joseph Cheng
2021년 6월 22일
if the starting matrix is a bit more complicated you can also use reshape() as well
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!