Decrease precision of decimal no value saved for a variable.
Show older comments
Hi, I wrote a script file and in that am solving some equations to get y1, y2. Now y1 = (some equation) and y2 = y1+2. Solving it I am getting y1 = -1.7383e-17 and y2 = 2 but I want it to solve and save values as either y1 = 0, y2 = 2 OR y1 = -1.7383e-17 and y2 = 2-(1.7383e-17) i.e, y2<2. I tried to set precision to 4 in beginning of my script file by giving command: digits(4); but still I am getting the same result. Thanks in advance.
1 Comment
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!