I want to access every nth value of a large matrix. How can I do that?

22 views (last 30 days)
I require a matlab code for resultant matrix obtained by picking every 9th element of a very large matrix. How can I do that?

Accepted Answer

Stephen23
Stephen23 on 21 Jul 2017
Edited: Stephen23 on 21 Jul 2017
Where M is your matrix, using simple subscript indexing:
M(1:9:end,1:9:end)
Or using linear indexing (not likely that you want this, but worth mentioning):
M(1:9:end)

More Answers (0)

Categories

Find more on Resizing and Reshaping Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!