Matrix Resize Rows and Cols
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 30 Aug. 2012
Bearbeitet: Andrei Bobrov
am 30 Aug. 2012
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
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!