Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
cell simplify and initilialize

Subject: cell simplify and initilialize

From: Mike

Date: 20 Oct, 2012 01:56:56

Message: 1 of 1

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

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us