MATLAB: The Windows Standalone Application doesn’t work out as its original file

MATLAB Compilersimulinkwindows standalone application; executable; open_system; simulink model;

Hello,
I've created an executable file from a .m file using the Deployment Tool, but the generated file doesn't work properly. It doesn't do the same thing as the .m file running directly from Matlab. I just want it to open a Simulink file (.mdl or .slx). Here follows the code:
%%%%%%%%%%%%%%%%%%
global ModelName
[filename, pathname] = uigetfile({'*.slx;*.mdl', 'Modelo (*.mdl, *.slx)'});
[pathstr, name, ext] = fileparts(filename);
modelo = strcat(pathname,filename);
open_system(modelo);
ModelName = name;
set_param(ModelName,'BlockReduction','off');
%%%%%%%%%%%%%%%%%%%%
Why this happens? Does anybody know what I can do?
Thanks!

Best Answer

open_system is an unsupported function which cannot be compiled. A list of supported/unsupported functions with various toolboxes can be found here:
open_system is listed here: