I'd like to have a statement that did:
my_angle = 1*pi;
fprintf('My angle is %.3f pi.\n',my_angle/pi);
but that produced My angle is 1.000 pi
, instead of the actual π character.
I'm thinking some sort of use of Unicode...
I found some related things:
I don't know how to do it with
fprintf
, butsprintf
works – just leave off the semicolon:Or you can use
disp
:The answer depends on your OS. On Windows Matlab uses the windows-1252 character set which is pretty limited. I think
char
with values greater than 255 you get nothing/squares. On Linux you can use full UTF8 character sets and can usechar
with any value you want.