필터 지우기
필터 지우기

Matrix Resize Rows and Cols

조회 수: 5 (최근 30일)
Amanda
Amanda 2012년 8월 30일
I have imported data as a matrix called A with a size
48 x 52 (48 Rows X 52 Columns).
How do I RESIZE the matrix to 48 X 48?
Thanks,
Amanda

채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 8월 30일
편집: Andrei Bobrov 2012년 8월 30일
A - your matrix (48x52)
Anew = zeros(48,48); % new matrix with size 48x48
s = size(A);
for jj = 1:s(1)
Anew(jj,:) = interp1(1:s(2),A(jj,:),linspace(1,s(2),size(A2,2)));
end
  댓글 수: 1
Amanda
Amanda 2012년 8월 30일
Thanks for your help. It is finally working.

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 8월 30일
imresize(A, [48 48])

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by