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

Walter Roberson
Walter Roberson 2012 年 8 月 30 日

2 投票

imresize(A, [48 48])

カテゴリ

ヘルプ センター および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by