Why my Windows Standalone Application doesn't work out as its original file?

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!

 채택된 답변

Harsheel
Harsheel 2013년 9월 20일

1 개 추천

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:

댓글 수: 3

+1
Simulink in general is not supported with MATLAB Compiler. You need to use Simulink Coder to generate standalone code from Simulink models in order to deploy them.
Actually, I wanted a GUI standalone that communicates with Simulink models. Is it possible with the Simulink Coder?! From what I've read, the Simulink Coder generates code from a Simulink model or Matlab functions. Does the Simulink Coder support a GUI code? My GUI purpose is to open a Simulink model and get data from it through listeners. Could you help me with that?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2013년 9월 18일

0 개 추천

댓글 수: 3

Vinicius
Vinicius 2013년 9월 18일
편집: Vinicius 2013년 9월 18일
Yes, it does. It's the executable that doesn't. I mean, the executable search for the file (uigetfile works), but it doesn't open the Simulink Model (which is the open_system job).
So it launches, it just doesn't do what you expect. Well I don't have Simulink (which I just added to the product list tag) so I can't help further.
Ok. Thanks anyway.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

질문:

2013년 9월 17일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by