implemented MatFromMatrix