Can't add a Greek letter into sprinf

14 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Labels and Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by