You can not make the resutling matrix having the same shortname as the source worksheet, unless you can delete the source worksheet after the copying. The following code will prefix the result with M:
%A=%H;
%B=page.longname$;
w2m;
page.longname$=%B;
win -r %H M%A;
While the following code will del the source and name the new matrix accordingly
%A=%H;
%B=page.longname$;
w2m;win -cd %A;
page.longname$=%B;
win -r %H %A;
CP