MATLAB: Is the sum outputting a curly bracket

display

I'm trying to output even numbers 2-200 in one single line of code, but instead of displaying the number it's displaying a curly bracket after the text.
Here's the code:
disp(['Sum of even numbers from 2 to 200 =',sum(2:2:200)])

Best Answer

You are attempting to combine strings and numeric data. That will not work.
Try this:
disp(['Sum of even numbers from 2 to 200 =',num2str(sum(2:2:200))])
The best option is likely sprintf or fprintf.