HOw to convert a variable to positive irrespictive of previous ?
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
madhan ravi
2018-10-17
编辑:madhan ravi
2018-10-17
abs() %gives you positive always which refers to absolute value
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!