You can flatten your matrices into column vectors (M1(:)) and then create a table from that. I see that you want the data in row major form, so you would have to transpose your matrix before flattening it.
M1 = M1';
M2 = M2';
t = table(M1(:),M2(:),'VariableNames',["M1 Value","M2 Value"])
t =
4×2 table
M1 Value M2 Value
________ ________
3 6
3 1
8 5
NaN 4