필터 지우기
필터 지우기

transform a 3x1 cell array containing {2x4}cell arrays into 2x1 cell array containing {3x4}cell arrays

조회 수: 1 (최근 30일)
C={ {[36 16 1 16 36] [20 12 2 12 22] [13 43 33 3 33 43 13] [19 4 19]
[40 20 5 20 40] [26 16 6 16 26] [17 47 37 7 37 47 17] [23 8 23]}
{[1 2 3 ] [4 5 6 7 8 9] [ 10 11 12 13 14 15 16 17 ] [18 19 20 21 22]
[23 24 25 26 27 28 29] [30 31 32] [33 34 35 36 37] [38 39 40 41 42]}
{[10 20 30 40 55 ] [66 77 88 99 111 122 133] [ 144 155 166 ] [177 188 199]
[222 233 244 255 266 ] [277 288 299 333 344 ] [355 366 377] [388 399 411 422 433]}
};
Tried using
U=cell2mat(C);
Result = mat2cell(U, c*ones(1,2), 4);
Error using cell2mat (line 52)
CELL2MAT does not support cell arrays containing cell arrays or objects.
Is there another function to do this? And how to do it for 10x1 {401x1300} to 401x {10x1300}?

채택된 답변

Andrei Bobrov
Andrei Bobrov 2017년 11월 30일
out = mat2cell(cat(1,C{:}),[3 3],4)
  댓글 수: 1
Joseph Lee
Joseph Lee 2017년 11월 30일
편집: Joseph Lee 2017년 11월 30일
Error using mat2cell (line 89) Input arguments, D1 through D2, must sum to each dimension of the input matrix size, [4010 1300].
out =mat2cell(cat(C{:}),[10 10],1300);
what is wrong here? should the [10 10] be [10 10 10 10.... x401]?
Just solved it using repmat(10,401,1)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by