How do I change certain value of a matrix by adding a something to the existing value?

1 回表示 (過去 30 日間)
A LL
A LL 2020 年 9 月 14 日
コメント済み: A LL 2020 年 9 月 14 日
I am very new to this.
I would like to change all the negative value of my matrix by 360+abs(existing value).
Let A be a matrix, I tried this:
A(A<0)=360+A
But it returns: Unable to perform assignment because the left and right sides have a different number of elements.
Could someone explain this to me?
Thank you

採用された回答

David Hill
David Hill 2020 年 9 月 14 日
A(A<0)=360+abs(A(A<0));

その他の回答 (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