Thread Subject:
Listing a Cell Array's Contents

Subject: Listing a Cell Array's Contents

From: james bejon

Date: 1 Apr, 2010 18:03:26

Message: 1 of 3

Dear All, Suppose I have a {1x2} cell array containing a {3x1} and a {4x1} cell, both of which containing strings. Is there a nifty way of listing these contents (as a {7 x 1} cell, that is)? Or perhaps as a {4x2} with an empty cell in the corner?

Subject: Listing a Cell Array's Contents

From: Doug Schwarz

Date: 1 Apr, 2010 18:06:55

Message: 2 of 3

james bejon wrote:
> Dear All, Suppose I have a {1x2} cell array containing a {3x1} and a
> {4x1} cell, both of which containing strings. Is there a nifty way of
> listing these contents (as a {7 x 1} cell, that is)? Or perhaps as a
> {4x2} with an empty cell in the corner?

If your 1x2 cell is called C then

   cat(1,C{:})

will do it.

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Subject: Listing a Cell Array's Contents

From: james bejon

Date: 1 Apr, 2010 18:27:08

Message: 3 of 3

That's nice. Thanks very much.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
list james bejon 1 Apr, 2010 14:04:08
array james bejon 1 Apr, 2010 14:04:08
strings james bejon 1 Apr, 2010 14:04:08
contents james bejon 1 Apr, 2010 14:04:08
cell james bejon 1 Apr, 2010 14:04:07
rssFeed for this Thread

Contact us