How can I get specified elements of matrix?

10 vues (au cours des 30 derniers jours)
Hannah Mohebi
Hannah Mohebi le 21 Août 2022
Commenté : Torsten le 21 Août 2022
I have a 1*28800 matrix and I want elements of this matrix which indexes are 10*i+1. How can I get these specified matrix?
for example
a=[1,2,3,4,5,7,8,910,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
I want a(1),a(11),a(21)
How can I code this in matlab?
  1 commentaire
Torsten
Torsten le 21 Août 2022
Better use
a=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
instead of
a=[1,2,3,4,5,7,8,910,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
to check
a(1:10:end)

Connectez-vous pour commenter.

Réponses (1)

Bruno Luong
Bruno Luong le 21 Août 2022

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by