how delete the '-' in front of numbers in a matrix?

1 回表示 (過去 30 日間)
elisa ewin
elisa ewin 2016 年 5 月 24 日
編集済み: Guillaume 2016 年 5 月 24 日
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?

採用された回答

the cyclist
the cyclist 2016 年 5 月 24 日
You mean you want to change all the negative numbers to positive numbers?
A = abs(A)
  1 件のコメント
Guillaume
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 ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by