How to use cell2mat for specific elements of cell array?
이전 댓글 표시
Hi everyone,
I am trying to create a double from specific elements of a cell array. If I have a cell array B, of dimensions 6x5, of which each element contains a double 10x4, such as:
for i = 1 : 6
for j = 1 : 5
A = randn(10,4)
B{i,j} = A;
end
end
I would like to create a big double out of all the rows and first 3 columns of B, and the second and third column of each interior double A (on this 6x3 cell array). Hence, the expected double C that should be a 60x6 matrix. I am using
C = cell2mat(B{:,1:3}(:,[2,3]));
But I get an error. What am I missing here?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!