How I can go to a new line in the following code:
M = 2;
L = 2;
For[n = 1, n <= M, n++, For[k = 0, k <= L, k++, Print[u[n, k] = n*k]]]
I want to go to a new line after running the inner loop. Can I use \n
?
I want to have:
Any suggestions?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this community
0 1 2
and the new line0 2 4
. $\endgroup$Table
and useMatrixForm
orTableForm
$\endgroup$Scan[Print[# Range[0, 2]] &, {1, 2}]
$\endgroup$WriteString[$Output,expr]
with"\n"
as needed for line breaks. I'd really encourage you not to try to writec
in mathematica though. $\endgroup$