MATLAB: String to double when string contains a / sign.
string double
I have a string like this: '2/10'. I want to convert it to a double, so 0.2 how can I do this?
Best Answer
You can usestr2num whicheval the string, instead ofstr2double. Note that since it evaluates the string any valid matlab expression in the string will be executed, therefore don't blindly pass user input tostr2num:
Best Answer