Sign minus, not hyphen
73 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I must replace the hyphen - with the minus sign in figures, obtained with the plot command.
It should be − (UTF-16: 2212), not -.
How can I set it in the plot command?
Thank you
0 Kommentare
Antworten (3)
Wilford Lie
am 2 Nov. 2023
Bearbeitet: Walter Roberson
am 2 Nov. 2023
If the above suggestions do not work, try the followings:
neg = char( hex2dec('2212') ); % HTML UTF-8 heximal code for negative sign
mstr = strcat("UTF", neg, "8: 2212"); % or whatever strng you want
title(mstr); % or annotation(...)
^_^
1 Kommentar
Walter Roberson
am 2 Nov. 2023
mstr1 = "UTF" + char(0x2212) + "8: 2212"
mstr2 = compose("UTF%c8: 2212", 0x2212)
mstr3 = compose("UTF\210228: 2212")
Unfortunately you cannot use a plain \x2212 in this circumstances, because \x sequences are variable length and there is no termination character, so there is no way to tell it to stop parsing between the \x2212 and the 8 that follows.
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!