Effacer les filtres
Effacer les filtres

For same Matrix subtraction between rows

4 vues (au cours des 30 derniers jours)
Vivek Shukla
Vivek Shukla le 14 Oct 2020
Commenté : Vivek Shukla le 15 Oct 2020
I have matrix size (1508 x 19).
I want to do subtraction between rows like Row 1 - Row 2, Row 1 - Row 4, Row 1 - Row 6, Row 1 - Row 8, Row 1 - Row 10, Row 1 - Row 12, Row 1 - Row 14,
Row 1 - Row 16, Row 1 - Row 18.
without changing the size of a matrix and remainng rows like (row 1, 3, 5, 7, 9, 11, 13, 15, 17, 19) stay same in matrix.
Can some one help me please
Thank you in advance...
  1 commentaire
João Mendes
João Mendes le 14 Oct 2020
So what do you want as a result?
A matrix where the first row is row1-row2? The second one row1-row4? and so on?
What is your final goal?

Connectez-vous pour commenter.

Réponse acceptée

Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam le 14 Oct 2020
a(2:2:end,:) = a(1,:)-a(2:2:end,:);
  3 commentaires
Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam le 15 Oct 2020
a(5:2:end,:) = a(3,:)-a(5:2:end,:);
Vivek Shukla
Vivek Shukla le 15 Oct 2020
thank you

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by