consider the following example
a={rand(1877958,7); rand(1251972,7)};
i want this to be converted to a matrix. i know that the rows are not the same but the remaining rows can be filled with zeros. how can i do that?
thanks

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 11월 26일

2 개 추천

a={rand(1877958,7); rand(1251972,7)};
n=max(cellfun(@(x) size(x,1),a));
b=cell2mat(cellfun(@(x) [x ;zeros(n-size(x,1),7)],a,'un',0))

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

질문:

AA
2014년 11월 26일

답변:

2014년 11월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by