Check out example codes for "fprintf matlab". It will help you in understanding the concepts better.

Code Example 1

A1 = [9.9, 9900];
A2 = [8.8,  7.7 ; ...
      8800, 7700];
formatSpec = 'X is %4.2f meters or %8.3f mm\n';
fprintf(formatSpec,A1,A2)

Learn ReactJs, React Native from akashmittal.com