How to I specify rows that are evenly spaced?
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
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
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 Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!