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: Choose Decimal Places
Replies: 1   Last Post: Feb 6, 2013 6:40 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Nasser Abbasi

Posts: 5,699
Registered: 2/7/05
Re: Choose Decimal Places
Posted: Feb 6, 2013 6:40 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 2/6/2013 5:28 PM, Abdul wrote:
> Hello,
> I have problem with decimal point. I need to output a variable with just
>two decimal points. I am using fprintf to output the variable.
>


maybe

EDU>> fprintf('%3.2f\n',pi)
3.14

EDU>> fprintf('%3.16f\n',pi)
3.1415926535897931


doc fprintf for more info





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.