convert cell array to matrix array

  • Follow


Hello All,
  I have 2D cell array  looks like:

'we'   '34'
'er'     '45'
'ty'      '3'
'ws'     '44'

I want to convert it into matrix(or double array) which will be like:
we  34
er  45
ty  3
ws  44

str2num, str2double ,cell2mat is not working .

I appreciate if anybody help me to move out  from this??

Thanks in advance.
0
Reply Mousmi 12/6/2010 11:54:05 AM

"Mousmi Chaurasia" <moumi.ksu@gmail.com> wrote in message <idiiss$2uq$1@fred.mathworks.com>...
> Hello All,
>   I have 2D cell array  looks like:
> 
> 'we'   '34'
> 'er'     '45'
> 'ty'      '3'
> 'ws'     '44'
> 
> I want to convert it into matrix(or double array) which will be like:
> we  34
> er  45
> ty  3
> ws  44
> 

'we', 'er', ... are not a double, how do you intend to put it in "double array"?

Bruno
0
Reply Bruno 12/6/2010 12:05:05 PM


"Mousmi Chaurasia" <moumi.ksu@gmail.com> wrote in message <idiiss$2uq$1@fred.mathworks.com>...
> Hello All,
>   I have 2D cell array  looks like:
> 
> 'we'   '34'
> 'er'     '45'
> 'ty'      '3'
> 'ws'     '44'
> 
> I want to convert it into matrix(or double array) which will be like:
> we  34
> er  45
> ty  3
> ws  44
> 
> str2num, str2double ,cell2mat is not working .
> 
> I appreciate if anybody help me to move out  from this??
> 
> Thanks in advance.

How can you have a matrix of doubles containing elements like we, er, ty ??

Wayne
0
Reply Wayne 12/6/2010 12:14:05 PM

"Mousmi Chaurasia" <moumi.ksu@gmail.com> wrote in message <idiiss$2uq$1@fred.mathworks.com>...
> Hello All,
>   I have 2D cell array  looks like:
> 
> 'we'   '34'
> 'er'     '45'
> 'ty'      '3'
> 'ws'     '44'
> 
> I want to convert it into matrix(or double array) which will be like:
> we  34
> er  45
> ty  3
> ws  44
> 
> str2num, str2double ,cell2mat is not working .
> 
> I appreciate if anybody help me to move out  from this??
> 
> Thanks in advance.

You can modify what you SEE with printing or output functions. But you cannot mix what you HAVE.

A hint:
sprintf

Oleg
0
Reply Oleg 12/6/2010 1:25:21 PM

3 Replies
545 Views

(page loaded in 0.037 seconds)

Similiar Articles:













7/24/2012 4:53:47 PM


Reply: