
Re: how to round to 2 decimal?
Posted:
Mar 6, 2013 12:13 AM


On 3/5/2013 7:33 AM, chabdullahsaleem@gmail.com wrote: > On Tuesday, March 4, 2008 8:23:02 PM UTC+5, Deo wrote: >> hey, how can I set my matlab program to round all the >> double numbers to 2 decimals > LET TAKE A SIMPLE EXAMPLE > x=pi; > sprintf('%.2f',x) > > now type this code in your m file and run it your output will be: > > x > > 3.14 >
But this does not round x to 2 decimal places.
x does not change in any way after this call.
Nasser

