How to split cell array made by matrix?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi everyone, i have a cell array made by n matrix ('n' is an input from the user).Every matrix is 3x3. I need to split this cell array in two halfs, how can i do it? I have tried in this way
num=1:1:N_ply;
lx = (length(num));
half = ceil(lx/2);
Q1 = Qk{num(1:half)}
where N_ply=8, and Qk is the cell array
댓글 수: 2
채택된 답변
Adam Danz
2021년 5월 14일
% c is a 1xn cell array where n is an even number
n = numel(c);
c1 = c(1:n/2);
c2 = c(n/2+1:end);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!