xtext = ['$\it{\bf{(A_{B}C)^{',rats(m),'}}}$'];
xlabel(xtext,'Interpreter','Latex','FontSize', 15 )
This is my code for my xlabel.
m, the slope, is always returned as a fraction and not as a decimal.
when I type "format bank" on the line before I still get the same result in my xlabel

 채택된 답변

Star Strider
Star Strider 2018년 12월 30일
편집: Star Strider 2018년 12월 30일

1 개 추천

The rats (link)call will produce a fraction.
Change that to something else if you want a decimal output.
Example —
m = pi;
xtext = sprintf('$\\it{\\bf{(A_{B}C)^{%.2f}}}$', m)
produces:

댓글 수: 1

Marisabel Gonzalez
Marisabel Gonzalez 2018년 12월 30일
when I just call m it messes up my latex.
What can I do?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품

릴리스

R2018b

태그

질문:

2018년 12월 30일

편집:

2018년 12월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by