convert string to number array in matlab

后端 未结 3 1462
小鲜肉
小鲜肉 2020-12-02 01:00

I have a script in which a string of number is entered

string=\'123\'

or

string=\'9823\'

I am trying to

3条回答
  •  时光取名叫无心
    2020-12-02 01:07

    use the function str2num()

    str = '123';
    str = str2num(str);
    

    Note: To verify that i'm correct, type in 'whos str' in the command window, and check the class. A string has a class, char, and numeric values have a class, double

提交回复
热议问题