MATLAB for motor electromagnetic calculation programming