How to select every nth value with the last value fixed from a column?

1 回表示 (過去 30 日間)
Noor Yaseen
Noor Yaseen 2019 年 10 月 21 日
コメント済み: Noor Yaseen 2019 年 10 月 22 日
I have a column of 4901 values starting from a value of -25 (at first position) to a value of 8579 (at 4901 th position). Now I want to have a new column that should comprise of values after every 100 th number BUT the last value ( i.e., 8579) should remain in the new column

採用された回答

Yuan Li
Yuan Li 2019 年 10 月 21 日
use
a = original_vector(1:100:4901);
  1 件のコメント
Noor Yaseen
Noor Yaseen 2019 年 10 月 22 日
編集済み: Noor Yaseen 2019 年 10 月 22 日
Thanks a lot Yuan Li, I got it.

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

その他の回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2019 年 10 月 21 日
a = original_vector([100:100:4901,4901]);
  1 件のコメント
Noor Yaseen
Noor Yaseen 2019 年 10 月 22 日
This is commendable. Thank you Andrei Bobrov

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by