HOw to convert a variable to positive irrespictive of previous ?

2 vues (au cours des 30 derniers jours)
Shubham Mohan Tatpalliwar
Shubham Mohan Tatpalliwar le 17 Oct 2018
Modifié(e) : madhan ravi le 17 Oct 2018
A=-3
B= 2
C= 4
D= A+B+C
D=9
As i am working on a loop A or B or C can be negative or positive but i have to put these in D as a positive value only

Réponse acceptée

madhan ravi
madhan ravi le 17 Oct 2018
Modifié(e) : madhan ravi le 17 Oct 2018
abs() %gives you positive always which refers to absolute value

Plus de réponses (0)

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by