View Single Post
Jan11-12, 11:10 AM   #2
 
Blog Entries: 5
Recognitions:
Homework Helper Homework Help
Science Advisor Science Advisor
Maybe you need to re-assign the result to the list:
Code:
LM = Append[LM, m]
(If this solves the problem, don't feel bad... you don't want to know how many hours I spent looking for similar mistakes)

Also, if the whole body of your module is a single If-statement, what do you need the module for?
You can just as well write
Code:
For[..., ..., LM = Append[LM, If[...]]]
instead of
Code:
For[..., ..., Module[m = If[...]; LM = Append[LM, m]]