Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'For Loop' topicStudent Support Forum > General > Archives > "For Loop"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Nasser M. Abbasi
09/08/12 02:18am


may be

b = {1, 2, 3, 4, 5};

For[v = 1, v <= Length[b], v++,
If[b[[v]] == 3, Print[v]]
]

rememeber that lists in Mathematica start at index 1 not zero. zero is the head of the expression not the data in the list.



URL: ,

Subject (listing for 'For Loop')
Author Date Posted
For Loop Mat 09/07/12 4:55pm
Re: For Loop Bill Simpson 09/07/12 9:52pm
Re: For Loop Nasser M. Ab... 09/08/12 02:18am
< Previous CommentHelp | Reply To Comment | Reply To Topic