Effacer les filtres
Effacer les filtres

Divide a specific element in a matrix

1 vue (au cours des 30 derniers jours)
Tran Thien
Tran Thien le 8 Mai 2019
Commenté : Tran Thien le 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 commentaires
James Tursa
James Tursa le 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 le 8 Mai 2019
Yes it is, sorry i'll edit it :D

Connectez-vous pour commenter.

Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 8 Mai 2019
A.*(2*eye(3)-1)
  1 commentaire
Tran Thien
Tran Thien le 8 Mai 2019
Thank you ! I did it :D

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by