What is the difference between 5 and '5'
Show older comments
5 + 1 = 6
'5' + 1 = 54
Why does the seceond line equal 54???
What does '' around numbers???
2 Comments
Star Strider
on 27 Aug 2019
To make things even more interesting:
"5" + 1 = "51"
Bruno Luong
on 30 Aug 2019
Associativity warning
>> "5"+1+2
ans =
"512"
>> 1+2+"5"
ans =
"35"
Accepted Answer
More Answers (0)
Categories
Find more on Text Data Preparation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!