Prev: Sparse matrix and ill defined linear equation
Next: help with xlswrite: deleting default worksheets
From: Garrett on 13 Aug 2010 15:45 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 13 Aug 2010 16:01 "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 13 Aug 2010 16:04 "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 13 Aug 2010 16:15 Thanks Sean worked like a charm!
|
Pages: 1 Prev: Sparse matrix and ill defined linear equation Next: help with xlswrite: deleting default worksheets |