How to select every nth value with the last value fixed from a column?

1 visualización (últimos 30 días)
I have a column of 4901 values starting from a value of -25 (at first position) to a value of 8579 (at 4901 th position). Now I want to have a new column that should comprise of values after every 100 th number BUT the last value ( i.e., 8579) should remain in the new column

Respuesta aceptada

Yuan Li
Yuan Li el 21 de Oct. de 2019
use
a = original_vector(1:100:4901);

Más respuestas (1)

Andrei Bobrov
Andrei Bobrov el 21 de Oct. de 2019
a = original_vector([100:100:4901,4901]);

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by