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!