fprintf and sprintf do not generate formatted text based on markup (like LaTeX or XML). Their output is pure text, and pure text does not store any formatting information at all (no color, no size, no typeface, no superscript, etc.). Pure text is just characters in a row, it is entirely up to the displaying application to decide how they should look like.
But luckily for you, one of the characters Unicode supports is "Superscript Two" (U+00B2), and because (recent versions of) MATLAB use Unicode to represent text characters, this character is easy to include in the fprintf format string using the \xH syntax given in the fprintf documentation:
>> fprintf('%.3f cm\xB2\n',pi)
3.142 cm²
