what does x='1' mean

1 Ansicht (letzte 30 Tage)
mariam moutaz
mariam moutaz am 25 Feb. 2021
Bearbeitet: mariam moutaz am 25 Feb. 2021
x='1'
y='2'
disp(x+y)
why is the answer 99
  2 Kommentare
Matt J
Matt J am 25 Feb. 2021
Did you run the code? If so, you should be able to tell us what the answer is.
mariam moutaz
mariam moutaz am 25 Feb. 2021
the answer is 99

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

David Hill
David Hill am 25 Feb. 2021
The + converts the characters into their double equivalent so they can be added.
double('1')+double('2');% = 99

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by