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: concatenate the elements of cell of cells containing both numbers and strings
Replies: 4   Last Post: Apr 29, 2012 2:35 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
sudesh

Posts: 15
Registered: 11/2/11
Re: concatenate the elements of cell of cells containing both numbers
Posted: Apr 29, 2012 9:37 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <994a11ea-d240-45bb-8988-825fc8344dc5@u7g2000yqc.googlegroups.com>...
> On Apr 28, 12:38 pm, "sudesh " <jsud...@gmail.com> wrote:
> > Hi all,
> >
> > I have a cell of cells containing both numbers and strings.
> > ex.
> > data={ {1} {'a'} {2} {'hg'};
> >            {3} {'ce'} {4} {'d'} } ;
> > I want to concatenate the elements and want the output like
> >
> > c=[ 1 a 2 h g 3 c e 4 d ];
> >
> > please help!

>
> -----------------------------------------------------------------------
> c = reshape(data', [1 8])
> celldisp(c)
>
> But it has to stay a cell array, you can't have it be a numerical
> array like you have.


Thanks a ton for your valuable help.
after applying this thing i got like

c={ {1} {'a'} {2} {'hg'} {3} {'ce'} {4} {'d'} };
is there any way to concatenate this single cell to form a character array?

c= ['1a2hg3ce4d'];
????



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.