How can I do a superscript of 6 for a unit (cm) in matlab using fprintf??
Script:
fprintf('Hexagon volume = %.3f %c %.3f %s^{6} \n', hexVol, 177, hexUnc, units ); *^{6} didn't work*
Command window:
Hexagon volume = 9.425 ± 1.571 cm6
`Hey,
Note: In case of any queries, just comment in box I would be very happy to assist all your queries
It is not possible to display subscripts or superscripts in the command window. The java text control that matlab uses does not support formatting with only a few exceptions. The only formatting supported is underline, bold, and changing the text colour. All of these are done using undocumented features of matlab.
The only possible is in the figures since we can include the TEX command in it.
Kindly revert for any queries
Thanks.
Get Answers For Free
Most questions answered within 1 hours.