| Author |
Comment/Response |
Thibault
|
03/14/12 09:33am
Hi all,
In my program I have two list, M and L, where each value of the list refer to two others list, D and C.
I need to take the first value of M and I compare it with L, if M[[i]]<L[[j]] I must increment i and when M[[i]]==L[[j]], do Print[D[[i]]] and replace i with the value of j. And I continue but this time I need to print C[[i]]
I tried this but it doesn't work:
Do[If[M[[i]] < L[[j]], i++,
If[M[[i]] == L[[j]], Print[D[[i]]] && M /. i -> j],{j,10000}]
And I don't know how I can print the first time D[[i]],the seconde time C[[i]] then D[[i]].....
If someone can help me, I use mathematica 8 and I hope that all is clear.
Thanks for your answers
URL: , |
|