Matlab to run SImulink with Compiled code Error

조회 수: 1 (최근 30일)
Virginia
Virginia 2013년 6월 19일
Hello, I have a script from which I call a Simulink MOdel. Inside this Simulink model I have some blocks that were programmed and compiled with VisualC++. When I run directly the Simulink model I have no problems, but when trying to run it from the script
options = simset('SrcWorkspace','current');
sim('mymodel.mdl',[],options)
I get the following error at the end of the simulation:
??? Error due to multiple causes.
Caused by:
Could not get structure variable.
Error in 'mymodel/S-Function_dirdynared' while executing C MEX S-function
'functionmine', (mdlTerminate), at time 10. MATLAB error message:
Could not get structure variable.
Any idea what is going on? Thank you very much in advance
  댓글 수: 2
Virginia
Virginia 2013년 6월 19일
I think I figured out the error source. Inside my VisualC++ code I have a statement that tries to store data in a structure storeData(Data,"data_loc"); And thi is giving me the error of Could not get structure variable But still I do not really know why or how to solve it
Kaustubha Govind
Kaustubha Govind 2013년 6월 19일
Does it look for a certain variable in the workspace? If so, where have you defined the variable - is it in the base workspace, or the workspace of the function that you are calling the SIM command from?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by