| MATLAB Central > MATLAB Newsreader > convert text to number |
|
|
|
I have a column of string values characterized as either 'wet' or 'dry'. What I would like to do is convert the 'wet' strings to a 1 and the 'dry' to zero. |
|
On Mar 9, 8:24 pm, "Jonathan" <jkak...@yahoo.co.uk> wrote: |
|
"Jonathan" <jkakiwi@yahoo.co.uk> wrote in message <hn4t2m$kap$1@fred.mathworks.com>... |
|
I have a matrix that is for example 1000 by 13. While the bulk of the columns are numbers, one of the columns has text in it that is either 'Wet' or 'Dry'. What I would like to do is simply change the 'Wet' text to 1 and the 'Dry' text to 0. I don't have matlab in front of me and will try these various options soon. I did have a look at strcmp but did not see anything obvious. |
|
Dear Jonathan! |
|
You mean its a cell array right? |
|
Jonathan wrote: |
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.
