![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199944/image.png)
Plot as a decimal and not a fraction
1 次查看(过去 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
0 个评论
采纳的回答
Star Strider
2018-12-30
编辑:Star Strider
2018-12-30
Change that to something else if you want a decimal output.
Example —
m = pi;
xtext = sprintf('$\\it{\\bf{(A_{B}C)^{%.2f}}}$', m)
produces:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199944/image.png)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!