I have a matrix like this (myb1):

I would like to get the matrix multiplication of each of the submatrix to itself. For example the first $2\times2$ matrix
$\begin{bmatrix}1 & 2\\1 & 2\end{bmatrix}$
should be multiplied by itself and answer of res2[[1, 1]] be $\begin{bmatrix}3 & 6\\3 & 6\end{bmatrix}$ and so on.
I tried: for loop (in the picture) and didn't help
Direct Mathematica code: myb1.myb1 and it didn't work out either
Mathematica Code
myb1[[1, 1]] = {{1, 2}, {1, 2}}
myb1[[1, 2]] = {{2, 3}, {3, 4}}
myb1[[2, 1]] = {{5, 2}, {8, 2}}
myb1[[2, 2]] = {{1, 2}, {1, 2}}
For[i = 1, i <= 2, i++,
For[j = 1, j <= 2, j++,
res2 = myb1[[i, j]].myb1[[i, j]];
]
]
MatrixForm, no matter how alluring its nicely formatted output might be: (18393). – MarcoB Jul 04 '15 at 02:55(myb1 = {{1, 2}, {1, 2}}) // MatrixForm;. Note the () brackets: they change the order of execution so that the variablemyb1is assigned the "raw" matrix, before theMatrixFormis evaluated. – MarcoB Jul 04 '15 at 04:04MatrixFormis a display function. it's used to show your results as a matrix, but is not used during calculations. you don't need to tell Mathematica "hey this is a matrix" because any rectangular list of lists is as good a matrix as you need. for exampleDet[{{a, 1}, {Graphics[Disk[]], d}}]will give an answer. this is a deliberate design feature. in particular, it means that all the functions you use for dealing with lists (such asReverse) can also be used directly on matrices... and vice versa. – amr Jul 04 '15 at 05:14