if function for array

2 次查看(过去 30 天)
A = [1,-3, 7; -4, -16, 2 ;3, 2,-10]
If there are numbers<0, I would like to change the minus to plus by using 'IF' statement.
The result I want is A = [1,3,7; 4,16 2; 3, 2, 10].

采纳的回答

madhan ravi
madhan ravi 2019-4-12
abs(A)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by