Best way to make a matlab - simulink closed loop simulation

조회 수: 2 (최근 30일)
Lorenz Padberg
Lorenz Padberg 2014년 5월 13일
답변: ragesh r menon 2014년 5월 14일
I have a given (and very large) set of matlab functions, that perform a simulation (calculate new states within a for loop). Now I have some algorithms implemented in Simulink that I want to invoke into the matlab function. Some of the matlab states are inputs of the Simulink model and the outputs of the model are processed in the matlab functions.
I was thinking about building a mex file from simulink to call it then in the m files calculation loop. But there is hardly any documentation about how to call such a level 2 mex file in matlab.
Does hanyone have example code or a tutorial how to do this? (Or a different approach)

답변 (2개)

A Jenkins
A Jenkins 2014년 5월 13일
  댓글 수: 1
Lorenz Padberg
Lorenz Padberg 2014년 5월 14일
Thanks for the answer, but this is not really what I am looking for since sim() just runs the whole simulation until the stop time. But how would you do it if have an integrator connected to the output of the model and its result is an input of the model.? I assume that I need to have access to the step function of the model.

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


ragesh r menon
ragesh r menon 2014년 5월 14일
can't you use MATLAB function blocks in Simulink to achieve this?

카테고리

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