Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


dpb
Posts:
9,602
Registered:
6/7/07


Re: scientific notation
Posted:
Jul 18, 2014 1:43 PM


On 07/18/2014 12:29 PM, Will wrote: > I have a script that formats multiple data sets and plots them in a > loop. Everything works perfectly but I would like the title to look > neater. This is how it is now: > > title(sprintf('%3.2f Hz',F(k))) > > where F(k) contains the different values that the graphs are titled > with. The titles become things like 0.16 Hz which is fine but some are > more like 100856.08 Hz. I would like all the titles to be expressed in > scientific notation (i.e. 1.60e1 Hz or 1.01e5 Hz). Any one have any ideas?
Use %e or %g instead of %f. You can control width and precision as desired.




