but when we define A='5', then char(5) can not be the result A. how can we get this value?

답변 (2개)

Ilham Hardy
Ilham Hardy 2015년 4월 17일

0 개 추천

Just guessing,
>> char(65)
ans =
A
>> double('A')
ans =
65
Star Strider
Star Strider 2015년 4월 17일

0 개 추천

You have defined ‘A’ as a string, so it will remain so. If you want to find the numeric value (5) you assigned to ‘A’, you would have to use the str2num or similar funcitons:
A = '5';
a = str2num(A)
produces:
a =
5.0000e+000

카테고리

도움말 센터File Exchange에서 Dates and Time에 대해 자세히 알아보기

제품

태그

아직 태그를 입력하지 않았습니다.

질문:

2015년 4월 17일

답변:

2015년 4월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by