Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

decimal places

4 views
Skip to first unread message

A Ram

unread,
Oct 24, 2009, 12:20:03 PM10/24/09
to
how can I reduce the number of decimal places in an output matrix ?

Thanks,

A Ram

unread,
Oct 24, 2009, 1:18:01 PM10/24/09
to
"A Ram" <shal...@gmail.com> wrote in message <hbv9fj$q3j$1...@fred.mathworks.com>...

> how can I reduce the number of decimal places in an output matrix ?
>
> Thanks,

Anyone ?

Jan Simon

unread,
Oct 25, 2009, 5:31:04 PM10/25/09
to
Dear A Ram!

> how can I reduce the number of decimal places in an output matrix ?

Do you mean rounding or just reducing the displayed digits?
1. ROUND(X * 1000) / 1000
2. fprintf('%.4f\n', X) or fprintf('%.4g\n', X)

Good luck, Jan

0 new messages