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

조회 수: 2 (최근 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