Error using latex in function
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Eitan Schechtman
am 21 Mär. 2016
Beantwortet: Walter Roberson
am 21 Mär. 2016
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 Kommentare
Akzeptierte Antwort
Walter Roberson
am 21 Mär. 2016
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu LaTeX finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!