Transferring Data between Cell Arrays
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi,
Simple question, is there a more efficient method of transferring batches data from one cell array to another.
B{1:5,1:8} = A{6:11,1:8};
Operations like this don't work, but I am hoping to find a method similar to this that does not involve for-loops, which is what I am currently doing.
for i = 1:5
for j = 1:8
B{i,j} = A{5+i,j};
end
end
댓글 수: 0
채택된 답변
the cyclist
2013년 3월 5일
Using the curly brackets is going to look into the contents. Instead, use parentheses to just assign the cells themselves:
B(1:5,1:8) = A(6:10,1:8);
(I also corrected your size mismatch.)
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Dynamic System Models에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!