Suppose I have a matrix,
Mat = MatrixForm[{{1.5, 2.83034}, {1.50476, 2.82655}}]
I need to define parameters such that in the matrix 'i'th component is 'Lambda' and 'j'th component is corresponding 'Neff' value.
How is that possible in Mathematica?
I tried this
For[i = 0; j = 0, i < 21 ; j < 21, i++, j++; Map[LambdaSS[i], NefS1[j]] = Mat[i, j]]
However, this generates error.
MatrixForm
. It is only a wrapper meant for display purposes. $\endgroup$ – Henrik Schumacher Feb 12 at 10:41Map[...]
is going to cause grief later. Is the assignment the wrong way round ? OP might want to investigate theArray
function for programmatic construction of arrays. $\endgroup$ – High Performance Mark Feb 12 at 11:23Part
, so it should beMat[[i,j]]
. See also The Four Kinds of Bracketing in the Wolfram Language. Moreover, For loops are evil. $\endgroup$ – Henrik Schumacher Feb 12 at 11:49