필터 지우기
필터 지우기

sqrt in figure label

조회 수: 323 (최근 30일)
Baba
Baba 2011년 11월 17일
댓글: Daan 2023년 11월 28일
how would i place a square root sign inside a figure axis label? someting like square root of X

답변 (1개)

Amith Kamath
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
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
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 CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by