how to decrease precision
이전 댓글 표시
I am trying to show to my students examples on the effect of rounds error when performing Gauss elimination without pivoting. This question is very easy with Maple, simply by fixing the numbers of desired digits with Digits:=4, for instance. In this way, I can show the errors appearing in the solution when performing Gauss elimination without pivoting.
But I do not know haw to proceed in Matlab, I always get the exact solution.
Thank you in advance.
댓글 수: 1
Rik
2019년 2월 17일
Are you using a numerical method, or are you using the symbolic toolbox? In the case of the first, you can use this:
digits=4;
data=(10^digits)*round(data/(10^digits));% round to n digits
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Mathematics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!