From: Garrett on
Hey guys,

I need to convert a 1 dimensional cell array of numbers that are in string format to an integer format.

example:

'1'
'2'
'3'

would be the cell array and we just want it to be
1
2
3

Any advice would be appreciated.
From: Sean on
"Garrett " <bantong(a)onid.orst.edu> wrote in message <i447c1$g83$1(a)fred.mathworks.com>...
> Hey guys,
>
> I need to convert a 1 dimensional cell array of numbers that are in string format to an integer format.
>
> example:
>
> '1'
> '2'
> '3'
>
> would be the cell array and we just want it to be
> 1
> 2
> 3
>
> Any advice would be appreciated.


One way:
cellfun(@(x)str2num(x),A)
From: Andy on
"Garrett " <bantong(a)onid.orst.edu> wrote in message <i447c1$g83$1(a)fred.mathworks.com>...
> Hey guys,
>
> I need to convert a 1 dimensional cell array of numbers that are in string format to an integer format.
>
> example:
>
> '1'
> '2'
> '3'
>
> would be the cell array and we just want it to be
> 1
> 2
> 3
>
> Any advice would be appreciated.

I'm pretty sure str2double will do this correctly.
From: Garrett on
Thanks Sean worked like a charm!