How to select a fixed number of rows with constant spacing?
Show older comments
Hello,
I am sure there is an easy fix for my problem but I just can't figure out.
I am trying to extract 21 rows out of matrices. The spacing between the 21 rows should be constant for a given matrix with the first and last selected rows being the first and last rows of the matrix. I have tried to use the following code:
sel = mat(1:floor(size(mat,1)/20):size(mat,1),:);
but the problem is that as mat changes size, I do not always obtain 21 rows in sel.
Would someone have a solution for me?
Thank you,
Benoit
Accepted Answer
More Answers (1)
Categories
Find more on Interactions, Camera Views, and Lighting in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!