good, as I do that the result was the same as on a calculator?
MATLAB error in counting
1 view (last 30 days)
Show older comments
How is it possible that my calculator comes out a different result than matlab calculated?
>> suma2= 7874;
str = ['označena plocha je 2', num2str(voxsuma2), ' mm^2.']
označena plocha je 215379.4968 mm^2.
15379,4968 or 215379.4968 is correct? WTH??
num2str is correct here, but the missing space after the 2 makes the result looking wrong, because the correct number 15379.4968 appears right after the 2. Try
str = ['označena plocha je 2 ', num2str(voxsuma2), ' mm^2.']
(Note the extra space after "je 2" before the num2str)
Its a formatting thing, the num2str works correct. take the number you see on the screen 215379.4968 and ignore the 2 in front of it and you will get 15379.4968. The 2 you see is the 2 you print before it with the text string "je 2". Its like a typo. The 2 doenst belong to the value which num2str gives but it looks like it does.
More Answers (1)
Find more on Matrix Indexing 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!