I wanted to write e^(-1000|t|) in matlab title of a plot. When I entered this and ran it actually, it showed ( as a superscript and every thing else in the line in regular font. Now I wanted the whole thing -1000|t| to appear as a superscript. I tried bracketing etc and finally I achieved what I wanted by inserting ^ before every letter. Is there a better way?

  • 1
    $\begingroup$ @ Seetha Rama Raju I am not sure about |t| but u can write in matlab as exp(-1000|t|) $\endgroup$
    – devraj
    May 1 '15 at 4:32
  • $\begingroup$ Thanks. That I know. I wanted the power to appear actually as power i.e. superscript. I could achieve that to with ^ before every letter. Was asking if there is a better way. $\endgroup$ May 1 '15 at 4:40
  • $\begingroup$ i don't get u. example for e^(5) in matlab it is exp(5) $\endgroup$
    – devraj
    May 1 '15 at 4:43
  • $\begingroup$ I am not asking about computing e^5. I am asking about how to write e^(some expression) in title of a plot. $\endgroup$ May 1 '15 at 5:10
  • $\begingroup$ Try putting braces around everything you want in the exponent: e^{-100|t|)} $\endgroup$ May 1 '15 at 5:34

You can write e^(-1000*|t|) in Matlab in colored form if you want as

title('\ite^{-1000 |t|}','Color','b') Here,"b" is for blue color ,"r" for red,"g" for greeen.

For subscript use _

For superscript use ^

For exponential symbol use \ite ,

For lambda symbol use \lambda

For alpha use \alpha.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.