While solving Cody problems, I have often encountered that my answer is not accepted because of the precision doesn't match the required answer. Matlab always rounds the double format to 4 digits after decimal. My logic seems correct on paper, but fails while applied as a code due to the precision problem.
Here's an example
Can somebody help me how to change this or how I can output more than 4 digits?
I know I can use vpa, but cody doesn't accept vpa and also it is symbolic.
6 Comments
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/617658-precision-problem-while-solving-cody-problems#comment_1067623
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/617658-precision-problem-while-solving-cody-problems#comment_1067623
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/617658-precision-problem-while-solving-cody-problems#comment_1067648
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/617658-precision-problem-while-solving-cody-problems#comment_1067648
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/617658-precision-problem-while-solving-cody-problems#comment_1068093
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/617658-precision-problem-while-solving-cody-problems#comment_1068093
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/617658-precision-problem-while-solving-cody-problems#comment_1068488
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/617658-precision-problem-while-solving-cody-problems#comment_1068488
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/617658-precision-problem-while-solving-cody-problems#comment_1068643
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/617658-precision-problem-while-solving-cody-problems#comment_1068643
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/617658-precision-problem-while-solving-cody-problems#comment_1069918
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/617658-precision-problem-while-solving-cody-problems#comment_1069918
Sign in to comment.