How to convert string to number?

we have extracted a value from GUI using
id1=get(handles.id1,'String');
Now i want to check if the value is a number. How do i do this?
If the value is a number that is converted to a string using the above line, how do I convert it back to a number?

Antworten (1)

Stephen23
Stephen23 am 6 Mai 2019
Bearbeitet: Stephen23 am 6 Mai 2019

0 Stimmen

"...how do I convert it back to a number?"
Convert to numeric:
num = str2double(id1)
"Now i want to check if the value is a number"
isn = ~isnan(num)

Kategorien

Mehr zu MATLAB Report Generator finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 6 Mai 2019

Bearbeitet:

am 6 Mai 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by