How to I specify rows that are evenly spaced?

1 Ansicht (letzte 30 Tage)
Ashley
Ashley am 11 Sep. 2013
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

Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 11 Sep. 2013
Bearbeitet: Azzi Abdelmalek am 11 Sep. 2013
A(30:38:end)
%Example
A=rand(1474,1);
out=A(30:38:end);
plot(out)
  1 Kommentar
Roger Stafford
Roger Stafford am 11 Sep. 2013
Based on the wording of the question, it should probably be:
out=A(30:38:1474);
in case A has more than 1474 rows.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by