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:
to create a cell array with the same content

Subject: to create a cell array with the same content

From: Wendy

Date: 30 Oct, 2010 13:19:03

Message: 1 of 2

Hi all,

I want to create a cell array with the same content give the size for the cell. For instance,

A ={ 'cell';
'cell';
'cell';
'cell';
'cell'};

I need to create a large list, so I cannot type in the cell elements one by one. It is also undesirable to use loops fill the content. So far, I have not find a function that create a cell array with the same content. (Something like ones(5,1)*10 for creating vectors).

If anyone knows, could you please let me know? Thank you in advance.

Wendy

Subject: to create a cell array with the same content

From: Matt Fig

Date: 30 Oct, 2010 13:35:03

Message: 2 of 2

C = repmat({'mycontent'},2,3)

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