how can I display an equation with the constants in the title

Answers (1)

Amruta - you can try using sprintf to create a string equation. Something like
n = 12;
n1 = 13.3;
ax = 42.42;
['something something is ' sprintf('%f=%f*e^(%f)',n,n1,ax)]
would produce the string
something something is 12.000000=13.300000*e^(42.420000)
You can do a better job of the formatting if you know if n, n1 and ax are integers are floats and (if the latter) how many digits after the decimal you wish to display. See format specification for sprintf for more details.

Categories

Tags

Asked:

on 18 May 2015

Commented:

on 18 May 2015

Community Treasure Hunt

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

Start Hunting!