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

549 ビュー (過去 30 日間)
Anne Nguyen
Anne Nguyen 2019 年 10 月 13 日
コメント済み: Stephen23 2022 年 4 月 27 日
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))
Stephen23
Stephen23 2022 年 4 月 27 日
NameOfVariable(end-999:end)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by