Okay, so let's say I have these lists and a number
a = {1, 2, 3};
b = {4, 5, 6};
And now I want to create 3 matrices that each look like this
M = {{n^2 - b^2, a*b}, {b*a, n^2 - a^2}}
My desired output is that M
is a list of 3 matrices, where
M = {M[[1]], M[[2]], M[[3]]}
and
M[[i]] = {{n^2 - b[[i]]^2, a[[i]]*b[[i]]}, {b[[i]]*a[[i]], n^2 - a[[i]]^2}}
I know I could use Table
to do this, but I guess there is a more elegant method. Thanks!
n[[i]]
in your code. Isn
also a list of numbers? $\endgroup$n
should be a single number andn[[i]]
makes no sense, it should be justn
$\endgroup$