Filter löschen
Filter löschen

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

243 Ansichten (letzte 30 Tage)
Anne Nguyen
Anne Nguyen am 13 Okt. 2019
Kommentiert: Stephen23 am 27 Apr. 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!

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 13 Okt. 2019
NameOfVariable(1:1000)
  3 Kommentare
Felix Mätzler
Felix Mätzler am 27 Apr. 2022
Bearbeitet: Felix Mätzler am 27 Apr. 2022
I think something like this:
NameOfVariable(length(NameOfVariable) - 999 : length(NameOfVariable))

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by