Matrix Resize Rows and Cols

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일

1 개 추천

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개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

질문:

2012년 8월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by