Making Matrix Dimensions Equal
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hinna Ahmed
el 28 de Oct. de 2019
Comentada: Hinna Ahmed
el 28 de Oct. de 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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/245278/image.png)
5 comentarios
Respuesta aceptada
Guillaume
el 28 de Oct. de 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
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!