Can't add a Greek letter into sprinf

15 ビュー (過去 30 日間)
Hasan Ghorbani
Hasan Ghorbani 2016 年 4 月 17 日
コメント済み: Nick 2021 年 8 月 17 日
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);

採用された回答

Walter Roberson
Walter Roberson 2016 年 4 月 17 日
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 件のコメント
Rie Larsen
Rie Larsen 2021 年 1 月 11 日
Thank you very much for the tip on using double-/ (//beta)
Nick
Nick 2021 年 8 月 17 日
Yes thank you. Been having that problem for awhile and couldn't figure it out

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLabels and Annotations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by