Filter löschen
Filter löschen

substract row of an array by a vector

1 Ansicht (letzte 30 Tage)
Cedrick De Block
Cedrick De Block am 13 Jul. 2021
Kommentiert: Stephen23 am 13 Jul. 2021
Hi,
I have an array of 63X2 and I want to substract the values of the 18, 36 and 54 of the first colum with 2 and then to addition the values of the 18, 36 and of the second colum with 2.
can someone help me with this please!!
Thank you in advance!!

Akzeptierte Antwort

Stephen23
Stephen23 am 13 Jul. 2021
Where A is your array:
X = [18,36,54];
A(X,1) = A(X,1) - 2;
A(X,2) = A(X,2) + 2;
  2 Kommentare
Cedrick De Block
Cedrick De Block am 13 Jul. 2021
Thank you very much, it works!!
Stephen23
Stephen23 am 13 Jul. 2021
@Cedrick De Block: please accept my answer if it helped you!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Cell Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by