sqrt in figure label
446 次查看(过去 30 天)
显示 更早的评论
how would i place a square root sign inside a figure axis label? someting like square root of X
0 个评论
回答(1 个)
Amith Kamath
2011-11-17
you would have to change the interpreter to latex, and then type in {\surd} in the xlabel (or any text) box. All the symbols are latex compatible, which is great, and you can make plots like this:
3 个评论
Amith Kamath
2011-11-18
oops! I did a Rick Perry there! :) The latex symbol for square root is \surd and not \sqrt. This should definitely work. Sorry for the slip-up! Try this:
plot([1:1:10])
title('{\itAe}^{-\alpha\itt}sin\beta{\itt} {\surd} \alpha<<\beta')
xlabel('Time \musec.')
ylabel('Amplitude')
Daan
2023-11-28
For any future person reading this: the Latex interpreter needs the string to be in 'Math'-text.
i.e. should be enclosed in $[text]$
Solutions:
xlabel('$\sqrt{x}$ [-]',Interpreter='latex')
or:
xlabel('$\surd$ x [-]',Interpreter='latex')
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!