Is it possible to callback model parameters for a matlab function block in a simulink model from right click/model properties/callbacks?

조회 수: 1 (최근 30일)
Hi everyone, i am trying to callback a matrix i have put in the model intialization function section when you right click on a simulink model and select model properties, then go on the callbacks tab.
The callbacks are recognised by the standard simulink fuction blocks, but not by the matlab function blocks
When i select the block, and go view, property inspector, there is no option for callbacks for this block, so i have to write the parameter within the matlab m file code for everything to run
I just would like to have all the model parameters in one place if possible,
Thanks in advance,
regards,
Aly

답변 (1개)

Shivang Menon
Shivang Menon 2017년 1월 23일
Right click on MATLAB Function block, go to properties, go to callbacks tab. For some reason, the property inspector of MATLAB Function block is different and does not show callbacks - MATLAB Function block editor
  댓글 수: 2
aly abidali
aly abidali 2017년 1월 25일
Shivang thank you for your answer, I highly appreciate it, but that didn't solve it... When im in simulink, and i right click and go on model properties, callbacks, I put most of my parameters in the initialise callback section, but for some reason when i use the matlab function blocks, it cant see the parameters that have loaded in the workspace, I have to specify them within each of the matlab function blocks for them to be seen, an example parameter would be I = 52 in model properties, callback, and i would have my fuction y=u*I in the fuction block, this will not work, i would have to put I = 52 within the matlab block for this to work, hope it makes sense
Akash Menon
Akash Menon 2018년 12월 11일
I have the same issue- if I put it in my function block- it gets re-initialized with every time step of the simulation. The simulation is basically like one big loop so it has to be initialized outside that in the callbacks.
I's also using Stateflow- will see if I can initialize it there using callbacks instead of writing the function block.
But do you have any advice on how to go about it?

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by