Divide a specific element in a matrix

1 Ansicht (letzte 30 Tage)
Tran Thien
Tran Thien am 8 Mai 2019
Kommentiert: Tran Thien am 8 Mai 2019
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 Kommentare
James Tursa
James Tursa am 8 Mai 2019
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 am 8 Mai 2019
Yes it is, sorry i'll edit it :D

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Fangjun Jiang
Fangjun Jiang am 8 Mai 2019
A.*(2*eye(3)-1)

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by