Divide a specific element in a matrix

1 回表示 (過去 30 日間)
Tran Thien
Tran Thien 2019 年 5 月 8 日
コメント済み: Tran Thien 2019 年 5 月 8 日
For example I have:
A=[1 2 3; 3 2 4; 5 4 1]
And I want it like this:
A=[1 -2 -3; -3 2 -4; -5 -4 1]
As you can see i'm trying to divide A12 A13 A21 A23 A31 A32 by -1, how can I do it?
Thank you
  2 件のコメント
James Tursa
James Tursa 2019 年 5 月 8 日
From your description, wouldn't the result be this instead?
A = [1 -2 -3; -3 2 -4; -5 -4 1]
If not, then what is the rule?
Tran Thien
Tran Thien 2019 年 5 月 8 日
Yes it is, sorry i'll edit it :D

サインインしてコメントする。

採用された回答

Fangjun Jiang
Fangjun Jiang 2019 年 5 月 8 日
A.*(2*eye(3)-1)
  1 件のコメント
Tran Thien
Tran Thien 2019 年 5 月 8 日
Thank you ! I did it :D

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by