How to I specify rows that are evenly spaced?

조회 수: 1 (최근 30일)
Ashley
Ashley 2013년 9월 11일
Hello, I am trying to access the 30th row of a column vector, and then the 68th row, and then the 106th row, all the way up to 1474. So basically, row 30, and then a difference of 38 up to row 1474. I need to access these data in order to plot them. Thank you.
Ashley

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 9월 11일
편집: Azzi Abdelmalek 2013년 9월 11일
A(30:38:end)
%Example
A=rand(1474,1);
out=A(30:38:end);
plot(out)
  댓글 수: 1
Roger Stafford
Roger Stafford 2013년 9월 11일
Based on the wording of the question, it should probably be:
out=A(30:38:1474);
in case A has more than 1474 rows.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by