Hello willi149,
Just in case you are not aware, MIKE SHE has its own auto-calibration tool built into it so you could use that instead.
If you really want to use the MATLAB approach I can't help you as I've never tried it.
Best regards,
Ricardo Machado