raise power to power in title

50 次查看(过去 30 天)
Hi~
I wanna write a title to a graph this way >> y = x * e^(- x^2 / 2 )
title(' y = x*e^(- x^2 / 2) ') writes e as base and only ( as exponent
title(' y = x*e^-^x^2^/^2 ') shows e^(-x2/2) not as e^(-x^2/2)
any idea how to solve this? :\

采纳的回答

Star Strider
Star Strider 2020-10-15
Try this (using LaTeX):
figure
plot(rand(50,1), rand(50,1), 'p')
axis([0 1 0 1])
title('$y = x \times e^{- \frac{x^2}{2}}$', 'Interpreter','latex', 'FontSize',16)
prodcing:
.
  1 个评论
Star Strider
Star Strider 2020-10-15
Write it the way I wrote it to use the LaTeX interpreter that MATLAB has. (I worte it entirely in MATLAB.)
If you want to write it in TeX instead (also suported by MATLAB):
title('y = x \times e^{- {x^2}/{2}}', 'FontSize',16)
.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by