i want to loop on K vector values(adsbygoogle = window.adsbygoogle || []).push({});

K = [3 5 7 9 11]

and have with me inside the loop the index of the current vector value

if i made

for K = [3 5 7 9 11]

disp(K)

end

i'll not have the index of K values

i mean when K=9 i want to know that i'm in index 4

how to make that??

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# How to loop on vector values and have indices too

Loading...

Similar Threads for loop vector values |
---|

Mathematica Looping through vectorized functions for a piecewise solution |

Mathematica While Loop in Mathematica |

MATLAB MATLAB vector multiplication |

**Physics Forums | Science Articles, Homework Help, Discussion**