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

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!

 Accepted Answer

NameOfVariable(1:1000)

3 Comments

how to select the last 1000 elements, please? I'm new to MATLAB too.
I think something like this:
NameOfVariable(length(NameOfVariable) - 999 : length(NameOfVariable))

Sign in to comment.

More Answers (0)

Categories

Find more on Beamforming and Direction of Arrival Estimation in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!