synchronizing simulink with m-file
조회 수: 5 (최근 30일)
이전 댓글 표시
im need to synchronize output from simulink with MATLAB platform
currrently what im using is (running in matlab platform)
rto = get_param(gcb,'RuntimeObject');
blockData = rto.OutputPort(1).Data ;
but it only gives me one data and it requires me to run it manaully. Need it to run in MATLAB platform automatically and in sync with the Simulink model.
Advise/Direction needed thanks.
댓글 수: 0
채택된 답변
Jarrod Rivituso
2011년 4월 14일
You can add a listener callback that runs when the block creates outputs:
h = add_exec_event_listener(gcb, 'PostOutputs', @callbackFcn);
More information is found here under "Listening for Method Execution Events".
댓글 수: 1
Jarrod Rivituso
2011년 4월 14일
I should mention also that there are blocks you can include in your model that will allow you to run MATLAB code from within Simulink, such as the "MATLAB Function" block, or the MATLAB S-function block.
추가 답변 (1개)
Tan Edwin
2011년 4월 18일
댓글 수: 6
Jarrod Rivituso
2011년 4월 20일
Ooops, looks like it changed. Here ya go
http://www.mathworks.com/help/toolbox/simulink/ug/f11-47048.html
참고 항목
카테고리
Help Center 및 File Exchange에서 Event Functions에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!