필터 지우기
필터 지우기

create Executable file from simulink model

조회 수: 4 (최근 30일)
Mitch Martelli
Mitch Martelli 2013년 1월 15일
댓글: giovanni mazzuto 2015년 1월 30일
Hi @ all,
I would like to ask you how I can build a model , using the Simulink Coder. I would like to call the so generated exe from a Matlab script.
I tried to performe this action in the following way :
I try to enables, in the configuration parameters mask, the load from workspace, but during the compilation the following warning appears: "Loading external input from the workspace is not supported for current code generation target".
I created the .exe file but it is not able to read data, through some input port, from the Matlab workspace.
In this case the target used for compiling is the generic real time (grt).
Some idea?
Thanks in advance
Mitch
  댓글 수: 1
Andrea Coraddu
Andrea Coraddu 2013년 1월 15일
Hi Mitch
I have the same issue!
Maybe someone can help us...

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

답변 (3개)

Kaustubha Govind
Kaustubha Govind 2013년 1월 15일
I think you might need to modify the generated code to accept the input from whatever source you need it to use.

Walter Roberson
Walter Roberson 2013년 1월 15일
When you generate an executable (rather than a mex) then it runs as an independent process and there is no connection to the MATLAB workspace (other than the command line options.)

Mitch Martelli
Mitch Martelli 2013년 1월 15일
How I can do this?
Maybe in the first question I have not been clear
Let me shown a simple example :
I have a simulink model called foo.mdl Inside the model there are :
input port
integration block
output port.
I would like to build foo.mdl.
Then I write the following Matlab code :
clc
clear variables
stoptime=input('stoptime') %10;
step=input('step') %0.01;
t=input ('t') %[0 stoptime];
u=input('u') %[0 1];
!foo.exe.
Then with the deploytool i would like to compile the matlab script.
My problems is the following :
How I can send the information receveid by a end user to foo.exe? When I build the simulink model all the parameter (stoptime, step, u,t) should be present in the matlab workspace.
Another problem if i put in the model only number and i complite with grt target the following warning appears: "Loading external input from the workspace is not supported for current code generation target".
  댓글 수: 2
Walter Roberson
Walter Roberson 2013년 1월 15일
Generate mex instead of a standalone executable and call it from MATLAB.
Or else modify the generated code to retrieve values from the command line (I don't know anything about the structure of the generated code so I do not know how you would have to modify the blocks to do this.)
giovanni mazzuto
giovanni mazzuto 2015년 1월 30일
have you some examples?

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

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by