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

2 visualizaciones (últimos 30 días)
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 comentario
Daniel
Daniel el 7 de Sept. de 2016
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) ];

Iniciar sesión para comentar.

Respuestas (1)

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

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by