MATLAB Answers

what does x='1' mean

22 views (last 30 days)
mariam moutaz
mariam moutaz on 25 Feb 2021
Edited: mariam moutaz on 25 Feb 2021
x='1'
y='2'
disp(x+y)
why is the answer 99
  2 Comments
mariam moutaz
mariam moutaz on 25 Feb 2021
the answer is 99

Sign in to comment.

Accepted Answer

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

More Answers (0)

Community Treasure Hunt

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

Start Hunting!