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

430 次查看(过去 30 天)
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!

采纳的回答

Walter Roberson
Walter Roberson 2019-10-13
NameOfVariable(1:1000)
  3 个评论
Felix Mätzler
Felix Mätzler 2022-4-27
编辑:Felix Mätzler 2022-4-27
I think something like this:
NameOfVariable(length(NameOfVariable) - 999 : length(NameOfVariable))

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by