How do I skip every other row of data in an array and write to a text file or another array?

34 visualizaciones (últimos 30 días)
I have an array (10 x 5 double) that looks like this;
2015 1a 1b 1c 1d
2015 2a 2b 2c 2d
2015 3a 3b 3c 3d
2015 4a 4b 4c 4d
2015 5a 5b 5c 5d
2015 6a 6b 6c 6d
2015 7a 7b 7c 1d
2015 8a 8b 8c 8d
2015 9a 9b 9c 9d
2015 10a 10b 10c 10d
I’m trying to come up with a consistent way to read every 3rd row of data, and then write it to another array or text file. The end result would be an array or text file whose contents look like this:
2015 1a 1b 1c 1d
2015 4a 4b 4c 4d
2015 7a 7b 7c 1d
2015 10a 10b 10c 10d
Any ideas on how to approach this are appreciated.
Thank you.

Respuesta aceptada

Mohammad Abouali
Mohammad Abouali el 23 de Sept. de 2015
every3rdRowData = Data(1:3:end,:)

Más respuestas (0)

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by