Join some matrices to one matrix

1 次查看(过去 30 天)
I have a cell array of matrix m{j} % which row numbers are different in each j
How can I bring all of them in one matrix?
For example:
m{1} = [2;3;4;7;1;20];
m{2} = [5];
m{3} = [1;2;70];
So, I need a new matrix like:
new = [2;3;4;7;1;20;5;1;2;70];

采纳的回答

Mikhail
Mikhail 2014-11-3
编辑:per isakson 2014-11-3
new=[];
for i=1:n % n - number of cells
new=[new;m{i}(:)]
end
%%% So we take each m{i}, turn it into 1 column calling m{i}(:) and join it to our new column

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by