|
"Sudipta Basu" <tupai_basu2004@yahoo.com> wrote in message
news:h04qg9$6gn$1@fred.mathworks.com...
> "Marcus M. Edvall" <edvall@gmail.com> wrote in message
> <e53d7a93-1b49-4b17-8906-9a19859bea93@h23g2000vbc.googlegroups.com>...
>> Hi Sudipta,
>>
>> You can execute this in Matlab:
>>
>> >> format bank
>> >> n=5.4356
>>
>> n =
>>
>> 5.44
>>
>> Best wishes, Marcus
>> Tomlab Optimization Inc.
>> http://tomopt.com/
>> http://tomsym.com/
>
> Thanx Marcus. Your suggestion has been quite helpful to me.
Be careful. The code Marcus gave you simply changes how the number is
_displayed_. It has no effect on how the number is _stored_ -- any
calculations that you perform later on will still use the full value of n,
not just 5.44.
The approach "someone" described earlier in this thread rounds the value of
the number, not just how it's displayed, but as he or she says there are
some caveats of which you should be aware. I second his/her recommendation
to read question 6.1 in the newsgroup FAQ (and the documents linked at the
end of that answer.)
--
Steve Lord
slord@mathworks.com
|