필터 지우기
필터 지우기

Can't add a Greek letter into sprinf

조회 수: 9 (최근 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 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