| Author |
Comment/Response |
Mat
|
09/07/12 4:55pm
Hi all, I have been having some success with the "For" function, however I cannot get it to work with the following example:
For example, I have the list:
b = {1, 2, 3, 4, 5};
For[v = 0, b[[v]] == 3, v++, Print[v]]
The aim of this code is it to print v as 3, because the 3rd number on the list is equal to 3.
This is a simplified version of my problem, but it arises when I use the "b[[v]]==n" as the test for the For loop.
Thanks,
Mat.
URL: , |
|