How do I only take the first 1000 elements of a vector?

539 visualizaciones (últimos 30 días)
Anne Nguyen
Anne Nguyen el 13 de Oct. de 2019
Comentada: Stephen23 el 27 de Abr. de 2022
My task is to use the first 1000 elements in a vector. So how do I only take the first 1000 elements of a vector? I am new to MATLAB, so any help would be appreciated. I tried finding a source to read about how to do this, but could not find one. Thank you!

Respuesta aceptada

Walter Roberson
Walter Roberson el 13 de Oct. de 2019
NameOfVariable(1:1000)
  3 comentarios
Felix Mätzler
Felix Mätzler el 27 de Abr. de 2022
Editada: Felix Mätzler el 27 de Abr. de 2022
I think something like this:
NameOfVariable(length(NameOfVariable) - 999 : length(NameOfVariable))
Stephen23
Stephen23 el 27 de Abr. de 2022
NameOfVariable(end-999:end)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by