Char not working properly ?
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello
char(8337)
but on my machine it doesn't work.
Other unicode work but not this one. Does anybody know what I should check ?
I'm on window 11 and my laptop is in french if that helps.
댓글 수: 7
Adam Danz
2023년 1월 9일
I was able to reproduce these difference between results shown here and on my local machine. Clearly the encoding is not consistent between the Run feature and my local installation and there are differences between recent releases. There were changes to system encoding in 22a (release notes) but that does not explain these differences and I haven't had time to look deeper.
unidec = hex2dec({'2090','2099','209c','2091','2099','2099','2090'})
str = ['T', char(unidec')]
text(0.5,0.5,str,'FontSize',24)
채택된 답변
VBBV
2023년 1월 9일
To display text on figure window, you should rather use uilabel function in place of uitextarea which produces same output as desired, This function also supports both latex and tex interpreters in contrast to former uitextarea function.
hFig=uifigure;
txa = uilabel(hFig);
txa.Text ='T_{antenna}'
txa.Interpreter = 'tex'
txa.FontName= 'Arial';
txa.FontSize=40;
txa.FontWeight='normal'
txa.Position = [100 274 170 45]
댓글 수: 0
추가 답변 (1개)
Sulaymon Eshkabilov
2023년 1월 6일
To display in a figure is straightforward, e.g.:
figure; title(char(8337))
text(0.5, 0.5, ['This is the character: ' char(8337)])
댓글 수: 3
Rik
2023년 1월 9일
The whole point of Unicode is not to have these things happen, so this behavior should be considered a bug. Please report it.
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!