The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: scientific notation
Replies: 4   Last Post: Jul 18, 2014 2:53 PM

Advanced Search

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

Posts: 9,850
Registered: 6/7/07
Re: scientific notation
Posted: Jul 18, 2014 1:43 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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.60e-1 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.


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.