Reshape a matrix into vector form and then again convert the array into previous dimensions matrix
조회 수: 9 (최근 30일)
이전 댓글 표시
Suppose I have a matrix of size mxn and i want to convert it into an array and perform some operations on it and then later i want to regain the original matrix of same size mxn from that array
for e.g
A=[55 53 52 ;54 53 52 ;56 56 54];
array = 55 53 52 54 53 52 56 56 54
and then this array
array = 55 53 52 54 53 52 56 56 54
matrix
A=[55 53 52 ;54 53 52 ;56 56 54];
댓글 수: 0
채택된 답변
Walter Roberson
2017년 3월 18일
array = reshape(A.', 1, [])
A = reshape(array, n, m).'
Notice this is not m, n.
댓글 수: 3
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!