MATLAB: Do I get an error when compiling the Simulink model using “eval”

compileerrorevalmodelpreferencessimulink

When I run the following command:
>> eval([FileName '([], [], [], ''compile'')'])
Where FileName is a a Simulink model file name, I get the following error:
Error in 'MyModel':
Initialization commands cannot be evaluated.
Caused by:
Too many input arguments.
When I run this command on another system, I do not get this error. How can I solve this?

Best Answer

Try regenerating your MATLAB preferences or copying the matlab.prf file from another machine. Please refer to the following link for regenerating your preferences: