how delete the '-' in front of numbers in a matrix?
1 次查看(过去 30 天)
显示 更早的评论
Hi, I have this matrix
A=[2010 -10 -19 23;2010 -10 -18 22;2010 -10 -17 23;2010 -10 -17 19];
how can delete the '-' in front of the numbers?
0 个评论
采纳的回答
the cyclist
2016-5-24
You mean you want to change all the negative numbers to positive numbers?
A = abs(A)
1 个评论
Guillaume
2016-5-24
编辑:Guillaume
2016-5-24
The numbers look suspiciously like dates, so it's possible that the negative numbers are simply the result of bad parsing of the original string. While fixing the problem post-parsing is certainly valid, it's probably better in the long term to fix the parsing instead.
But that's worthy of another question by the OP.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!