Filter löschen
Filter löschen

How do I select rows with particular step size?

7 Ansichten (letzte 30 Tage)
Laliguras
Laliguras am 26 Mär. 2013
Hi, I have a 25000 X 5 matrix. I need to select rows to create new subset of matrices with particular order of rows for e.g. 1,21,41,..., 2,22,42,....., 3,23,43,...and 20,40,60...... I would appreciate your input and thank you in advance.

Akzeptierte Antwort

Mahdi
Mahdi am 26 Mär. 2013
If A is the 25000 X 5 matrix, then you can just use:
A(1:20:end, :)
to get 1,21,41,... from all of the columns. If you want data from just the first column, use
A(1:20:end, 1)
Look at what the : operator does to help you.
  1 Kommentar
Laliguras
Laliguras am 26 Mär. 2013
Thanks for quick response. It is exactly what I was looking for.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Types finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by