Hi,
I tried to do simple code using Mathematica which i’ll use later for my mathematics calculation but it seems not like what I expected
For[n=1, n<12, n++,
If[OddQ[n],
Z[n_] := n * i,
Z[n_] := n * k ]]
I expected that the result would give :
Z[1] = i
Z[2] = 2k
Z[3] = 3i
Z[4] = 4k
and so on
However, the results are
Z[1] = i
Z[2] = 2i
Z[3] = 3i
Z[4] = 4i
and so on..
anybody can help? Thanks