In the COMSOL Desktop go to the Preferences and select
Security, locate the
General section. To permanently enable an external MATLAB function, in the list
Allow external MATLAB® functions select
Yes. To enable an external MATLAB function only once, set the list
Allow external MATLAB® functions to
Ask. Using the latter option, you will be asked to enable external functions when the function is run.
Add the flag -allowexternalmatlab on to the COMSOL startup command to permit external MATLAB functions to run.