Clear Filters
Clear Filters

raise power to power in title

32 views (last 30 days)
Nora Al Allaf
Nora Al Allaf on 15 Oct 2020
Commented: Star Strider on 15 Oct 2020
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? :\

Accepted Answer

Star Strider
Star Strider on 15 Oct 2020
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 Comment
Star Strider
Star Strider on 15 Oct 2020
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)
.

Sign in to comment.

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!