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)
No products are associated with this question.
Not with plain indexing. This one-liner does it
r = cellfun( @(v) v(1), A )
However, ...
2 Comments
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/53955#comment_111638
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.
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/53955#comment_112009
Hi Matt, thanks for your reply...Yes I guess I chose a bad example but I just chose a bad example for what I want to do...not necessarily all of them will be the same size still I would like to call the first position for different purposes.