For loop that takes element from certain locations in vector and creating a new one using picked out elements, please!

3 次查看(过去 30 天)
Hi,
I need help with this:
For loop that takes element from certain locations in vector h, and creating a new one, H using those picked out elements?
I have a vector column vector h containing 25001 elements and want to pick out element that are in position 1001, 2001, 3001, 4001 and so on. How can i do that in a for or any other tool?
Best regards,
Daniel
  1 个评论
Daniel
Daniel 2016-9-7
Instead of doing it like this:
T=[T(0001) T(1001) T(2001) T(3001) T(4001) T(5001) T(6001) T(7001) T(8001) T(9001) T(10001) T(11001) T(12001) T(13001) T(14001) T(15001) T(16001) T(17001) T(18001) T(19001) T(20001) T(21001) T(22001) T(23001) T(24001) T(25001) ];

请先登录,再进行评论。

回答(1 个)

José-Luis
José-Luis 2016-9-6
Please read this. You don't need a loop.

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by