Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to convert string to num?

  1. Dec 18, 2007 #1

    vky

    User Avatar

    how to convert string to num??

    hi guys,

    I'm currently doin a GUI on matlab and I'm taking in a user input in a text box as string(not sure as wat), how can I convert it to a number?
    Any help on that, much appreciated.
    Thanks
     
  2. jcsd
  3. Dec 19, 2007 #2

    mda

    User Avatar

    there's lots of different ways, some work better than others (experiment to find out which work for you)...

    str2num, sscanf, strread
     
  4. Dec 19, 2007 #3

    vky

    User Avatar

    HI, thanks for your help, str2num does work.
    cheers
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?