Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Putting text containing variables into plot
Replies: 3   Last Post: Apr 24, 2013 5:10 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Kian

Posts: 12
Registered: 4/16/13
Putting text containing variables into plot
Posted: Apr 24, 2013 2:32 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

How can I put a text into my plot which passes computed values in there?
For instance, I have computed my parameters to be:

pars =
0.0005 42.1963

Now I want to put a text in an appropriate position in my plot (where it does not block the figure content), and pass pars(1) and pars(2) in there.

My formula is omega(d) = exp(-pars(1)*d^pars(2))

So, I want to have Matlab to put that for me in the plot as:

omega(d) = exp(-0.0005*d^pars(2))

I have already tried to put it in the title by:
title([ '\omega(d)=exp (' , num2str(pars(1),'%4.5f') , ' d^' , (num2str(pars(2))), ')' ])

But still, the problem is pars(2) is not completely powered, and only its first digit (4) is powered.

I am really interested to put it rather as a text somewhere in my plot.

I appreciate any help.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.