Why does input() display this string improperly?

조회 수: 1 (최근 30일)
Nicholas
Nicholas 2016년 10월 5일
편집: Marc Jakobi 2016년 10월 11일
I'm curious about displaying unusual characters via the char() command and how these strings behave when passed to input().
For example, this string displays the Greek character Omega at the command line, but the same string passed through input() does not. Is this a limitation of input() or some bug resulting from locale settings?
>> str = ['Value ' char(937) ' ? ']
str =
Value Ω ?
>> input(str)
Value ?
Currently running R2015b.

채택된 답변

Marc Jakobi
Marc Jakobi 2016년 10월 5일
It must be a bug. It seems to be fixed in Matlab R2016b.
  댓글 수: 1
Marc Jakobi
Marc Jakobi 2016년 10월 11일
편집: Marc Jakobi 2016년 10월 11일
Actually, it may have something to do with the fonts you have installed or the regional settings, as explained here.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Matthew Eicholtz
Matthew Eicholtz 2016년 10월 5일
I could not reproduce your error, but I am using R2016a, so maybe that is the reason.
As an alternative, try:
str = sprintf('Value %s ?',char(937));
input(str);
Does that produce the desired result?
  댓글 수: 1
Nicholas
Nicholas 2016년 10월 5일
Same error, unfortunately. Sounds like an R2015b bug. Thanks for the attempt!

댓글을 달려면 로그인하십시오.

카테고리

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