Making Matrix Dimensions Equal

1 次查看(过去 30 天)
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 个评论
Hinna Ahmed
Hinna Ahmed 2019-10-28
for instances, the matrix in the first row has a size of 501 x 55, so to chnage its size to 501 x 53, column 54 and 55 should be deleated.

请先登录,再进行评论。

采纳的回答

Guillaume
Guillaume 2019-10-28
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by