Calling a Simulink model by using feval
조회 수: 16 (최근 30일)
I am working on a Simulink model. There is a trim code which is calling this model by using feval as follows.
Y = feval(model,0,x,u,'outputs')
Xd = feval(model,0,x,u,'derivs')
However, it only gives the outputs of the model but I need the outputs from to workspace blocks too. How can I obtain these outputs?
And also I would like to ask is there any documentation about this kind of usage of feval.
Sara Nadeau 2023년 4월 18일
I am not sure that feval is really the relevant part of what is happening here. feval calls another function. In this case, this doc page covers the functionality that it looks like you're using here: https://www.mathworks.com/help/simulink/ug/simulink-model-command.html
To get the values for the To Workspace blocks, I suspect you need to connect the signals to Outport blocks in the top model. It looks like the model name interface returns values for "model outputs" which usually means the values for top-level Outport blocks.