when char(65) then A.

1 vue (au cours des 30 derniers jours)
parthasarathi ghorai
parthasarathi ghorai le 17 Avr 2015
but when we define A='5', then char(5) can not be the result A. how can we get this value?

Réponses (2)

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

Star Strider
Star Strider le 17 Avr 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)
produces:
a =
5.0000e+000

Catégories

En savoir plus sur Dates and Time dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by