I'm new to Mathematica. Below is the code I have trouble with.
Do[Print[
Subscript[C, k][x_, y_]: =
Subscript[q, 2 k - 1] + x*Subscript[q, 2 k] - (Subscript[q, l] + y*Subscript[q, l + 1])
],
{k, 3, 5}, {l, 3}]
In this loop, I want k=3 map to l=1, k=4 map to l=2, and k=5 map to l=3. However in this loop function, it loops through l=1,2,3 when k=3 and so on. So is there an automatic way or code to stop the certain looping?
k
and instead ofl
putk-2
. $\endgroup$ – Kuba♦ Jan 14 '14 at 1:00Print
ing a function definition will give youNull
. Not really useful. $\endgroup$ – asterix314 Jan 14 '14 at 3:22