when char(65) then A.

4 visualizzazioni (ultimi 30 giorni)
parthasarathi ghorai
parthasarathi ghorai il 17 Apr 2015
Risposto: Star Strider il 17 Apr 2015
but when we define A='5', then char(5) can not be the result A. how can we get this value?

Risposte (2)

Ilham Hardy
Ilham Hardy il 17 Apr 2015
Just guessing,
>> char(65)
ans =
>> double('A')
ans =

Star Strider
Star Strider il 17 Apr 2015
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)
a =


Non è stata ancora inserito alcun tag.


Community Treasure Hunt

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

Start Hunting!

Translated by