Filter löschen
Filter löschen

Can't add a Greek letter into sprinf

9 Ansichten (letzte 30 Tage)
Hasan Ghorbani
Hasan Ghorbani am 17 Apr. 2016
Kommentiert: Nick am 17 Aug. 2021
Hi,
I am having problem with adding \angle character into my sprintf command. The result is for command window only.
Here is the line I need to add the character to:
out = arrayfun(@(x, y) sprintf('%f \angle %7.4f°', x, y), absA, phaseA, 'uni', 0);

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 17 Apr. 2016
Angle is not a greek character.
You are trying to use tex with command window output. That will not work. Unicode might work if you are using an appropriate font.
anglechar = char(8736);
out = arrayfun(@(x, y) sprintf('%f %s %7.4f°', anglechar, x, y), absA, phaseA, 'uni', 0);
  5 Kommentare
Rie Larsen
Rie Larsen am 11 Jan. 2021
Thank you very much for the tip on using double-/ (//beta)
Nick
Nick am 17 Aug. 2021
Yes thank you. Been having that problem for awhile and couldn't figure it out

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Labels and 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!

Translated by