MATLAB: How to display data with commas or spaces

output display numerics

I am unable to find the syntax to display output data with commas or spaces used to separate groups of three digits in order to improve readability. For example, instead of 3.14159 display 3.141 59 or instead of 200000 display 200,000. Did I miss something?

Best Answer

There is no "format" option for that, and there is no format specifier for sprintf() or fprintf() for that. You will need to convert your values to string form and process the string.