Making Matrix Dimensions Equal
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hinna Ahmed
am 28 Okt. 2019
Kommentiert: Hinna Ahmed
am 28 Okt. 2019
Hey,
I have this cell with 12 different matrix. They are all of different size in length. How can I make all of them equal to 501 x 53 in size.
5 Kommentare
Akzeptierte Antwort
Guillaume
am 28 Okt. 2019
smallestwidth = min(cellfun('size', yourcellarray, 2)); %smallest width of all matrices in the cell array
newcellarray = cellfun(@(m) m(:, 1:smallestwidth), yourcellarray, 'UniformOutput', false); %crop all matrices inside the cell array to the smallest width
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical 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!