To get things exactly in the kind of output you mentioned, you would need eval() (which some people recommend avoiding):
for i=1:n
eval( ['M' num2str(i) ' = zeros(4);'] );
end;
All of these methods are possible; which one is best depends on what format you ultimately want your data to be in. I don't know what format you ultimately need since I don't know what your purpose is, but all else being equal, I think Alex's first suggestion is the best.
Also please note that, when posting a request for coding help, it's best to explain clearly what your problem was. In this case the issue is simple, so when you say "this code doesn't work" it's easy enough for me to figure out what happened (you ended up with one variable called 'Mi', rather than variables 'M1', 'M2', M3', etc.). But normally, "this doesn't work" is not clear enough for anyone to help. You should always say specifically what the problem was, either "this is the exact error message I received:" or "the kind of output I got from MATLAB was like _______, which is different from what I wanted to get, which is _______".