Plot as a decimal and not a fraction

1 回表示 (過去 30 日間)
Marisabel Gonzalez
Marisabel Gonzalez 2018 年 12 月 30 日
編集済み: Star Strider 2018 年 12 月 30 日
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 日
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 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by