How to get the value (number) that is in a string?

조회 수: 2 (최근 30일)
Zineb EL MORCHID
Zineb EL MORCHID 2016년 4월 6일
댓글: Zineb EL MORCHID 2016년 4월 6일
To lighten my question ,for exemple let's take d='1'; I want to increment 1 it to get 2 as result. So I tried to convert it to double by using double(d)+1; I got 50. Obviously '1' is 49 in double , same thing I got by using int8 . which function should I use to get 2 as result?

채택된 답변

Image Analyst
Image Analyst 2016년 4월 6일
Like this:
doubleD = str2double(d);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by