Error using latex in function
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello, I'm trying to use latex to insert a specific symbol using the "text" command in Matlab 2014b. The line in my function is pretty straightforward:
text(1.5,0.43,'\fontname{Lucida sans unicode}\fontsize{12}?')
(the symbol appears as a box in the Matlab editor window)
When using this line in a function, a question mark is displayed instead of the symbol. However, when using the same line from the command window the symbol appears with no problems. Finally, I tried inserting a breakpoint at this line in the function and then inserting it to the command line - and it also works fine.
Any ideas regarding how I can display the symbol without resorting to breakpoints as a way of life?
Thanks, Eitan
댓글 수: 0
채택된 답변
Walter Roberson
2016년 3월 21일
Is the symbol one whose Unicode position is 256 or greater? If so then you might not be able to hard-code without taking special steps to convert your MATLAB to use UTF8 .m files. Try building up a string with char() of the numeric position, such as
text(1.5, 0.43, ['\fontname{Lucida sans unicode}\fontsize{12}', char(1234)])
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 LaTeX에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!