Decrease precision of decimal no value saved for a variable.
Afficher commentaires plus anciens
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 commentaire
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!