But when loading data.mat in Matlab, I find that M splits into multiple variables with names like Expression1, Expression2, Expression3 ....
I also tried XLS format, but each 4x4 matrix in the list of matrices appears in an individual worksheet.
So my question is how can I put M in a single variable, thus I could manipulate it.

You could export Flatten[m] and then use reshape(Expression,[100 4 4]) (not sure about syntax) in the other software.
–
b.gatessucksJan 19 '13 at 12:53

thanks ssch and b.gatessucks ,M is not a constant matrix, posted is just an example, Flatten[m] does work, but I found reshape changed the structure of M.
–
noviceJan 19 '13 at 13:18

@user5463 The structure is different because one uses row major ordering and the other column major ordering to store the arrays. See this question and the answers there for a way to convert (the answers deal with converting in mma... you can do something similar in matlab)
–
rm -rf♦Jan 19 '13 at 17:13

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.