I would like to have a statement that did:
my_angle = 1*pi; fprintf('My angle is %.3f pi.\n',my_angle/pi);
but it created My angle is 1.000 piinstead of the actual symbol π.
My angle is 1.000 pi
I am thinking of some use of Unicode ...I found some related things:
I don't know how to do this with fprintf, but it sprintfworks - just leave a semicolon:
fprintf
sprintf
sprintf('My angle is %.3f %c.\n',my_angle,char(960))
Or you can use disp:
disp
disp(['My angle is ' num2str(my_angle,'%.3f') ' ' char(960) '.']);
. Windows Matlab Windows-1252, . , char 255 /. Linux UTF8 char , .
char