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개)

Andrei Bobrov
Andrei Bobrov 2019년 10월 21일
a = original_vector([100:100:4901,4901]);

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by