Deleting every n rows in matrix

17 vues (au cours des 30 derniers jours)
Niet hier
Niet hier le 13 Avr 2021
Commenté : Niet hier le 14 Avr 2021
I have a matrix of m x n
I want to keep the first row and then delete 14 rows and then preserve the 16th row, then delete the next 14 rows and preserve the 31th row.
What is the best way to do this?

Réponse acceptée

David Hill
David Hill le 13 Avr 2021
Modifié(e) : David Hill le 13 Avr 2021
newMatrix=oldMatrix(1:15:end,:);

Plus de réponses (1)

Fangjun Jiang
Fangjun Jiang le 13 Avr 2021
A=1:100
A=A(1:15:end)

Community Treasure Hunt

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

Start Hunting!

Translated by