Calling multiple cell elements at once
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello,
I have a cell something like
A=
[1x3 double] [1x3 double] [1x3 double] [1x3 double]
Is it possible to call the first position of each vector at once? Something like
A{:}(1)
댓글 수: 2
Matt J
2012년 11월 17일
Since your A{i} are all the same size and numeric type, it is puzzling why you would maintain it in cell form, as opposed to a 4x3 matrix for example.
채택된 답변
추가 답변 (1개)
per isakson
2012년 11월 17일
Not with plain indexing. This one-liner does it
r = cellfun( @(v) v(1), A )
However, ...
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!