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:
Help with modifying cell array display

Subject: Help with modifying cell array display

From: Gautam Sethi

Date: 23 Mar, 2013 23:31:14

Message: 1 of 2

I have a cell array C with n columns (where n can vary) and

C =

     'Jane Doe' ' '
     'Johnny Doe' 'Johnny Appleseed'
     'Apple Doe' 'Johnny Jane '


I would like MATLAB to print it as

     Jane Doe
     Johnny Doe Johnny Appleseed
     Apple Doe Johnny Jane

I'd appreciate if someone can help me with this.

Gautam.

Subject: Help with modifying cell array display

From: Bruno Luong

Date: 24 Mar, 2013 09:14:07

Message: 2 of 2

Gautam Sethi <gautamsethi@gmail.com> wrote in message <b242adb4-71b7-4638-948a-d725a072eb94@googlegroups.com>...
> I have a cell array C with n columns (where n can vary) and
>
> C =
>
> 'Jane Doe' ' '
> 'Johnny Doe' 'Johnny Appleseed'
> 'Apple Doe' 'Johnny Jane '
>
>
> I would like MATLAB to print it as
>
> Jane Doe
> Johnny Doe Johnny Appleseed
> Apple Doe Johnny Jane
>
> I'd appreciate if someone can help me with this.
>
> Gautam.

 Ct=C';
fprintf([repmat('%s ', 1, size(C,2)) '\n'], Ct{:})

% Bruno

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