Question: How to use "subs[inplace]" element wise?

Hello, I have different values to substitute into my theta in a matrix. I tried to use the subs function but the results came out are all dashes. Have you any idea how to fix it please?

AA:=RandomMatrix(3,5);
BB:=map(cos,AA*theta);
CC:=RandomMatrix(3,5);

I tried method 1:

subs[inplace](theta=CC,BB);

Method 2:

DD:=Matrix(3,5);
for m from 1 to 3 do
for n from 1 to 5 do
DD(m..m,n..n):=subs(theta(m..m,n..n)=CC(m..m,n..n),BB(m..m,n..n));
end do:
end do:
DD;

Thank you.

Please Wait...