Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: cell simplify and initilialize
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Mike

Posts: 336
Registered: 4/17/07
cell simplify and initilialize
Posted: Oct 19, 2012 9:56 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi

following code needs to be simplified
>> A=cell(2,3);
>> A{1}(:)=[5:8,14:15,19:20]

??? In an assignment A(:) = B, the number of elements in A and B
must be the same.

Sure following it's ok, but clumsy.
A{1,1}=5:8
A{1,2}=14:15
A{1,3}=19:20

Furthermore, if I need only one element for A(2,:), i.e. A{2,1} and not necessary for A{2,2} and A{2,3}, how to do it?

Thanks.

Mike



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.