How can I get specified elements of matrix?

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 Comment

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)

Sign in to comment.

Products

Release

R2020b

Asked:

on 21 Aug 2022

Commented:

on 21 Aug 2022

Community Treasure Hunt

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

Start Hunting!