필터 지우기
필터 지우기

Update attribute value with a frequency and use in matlab function

조회 수: 1 (최근 30일)
Mehwish Ahmed
Mehwish Ahmed 2018년 9월 17일
댓글: Mehwish Ahmed 2018년 9월 18일
Hello,
I have two attributes assigned to the entity in the entity generation, the current time in system and the priority. I want to update these attributes with a frequency, for example every day. These values will be used in the matlab function which determines to release the entity or not. Now the attribute value can only be updated when entering a block, while the entity stays until there is a positive message to release the entity. I saw this question but its an older version of simulink.. Does anyone know how to model this? Thanks

답변 (1개)

Naveed Ahmed
Naveed Ahmed 2018년 9월 17일
Here is what I can suggest based on my understanding:
Place your matlab function block in the "enable subsystem" and connect the square pulse generator (in case you want it periodically) with enable input of the Enable system input port. The pulse width and shape are easily modifiable from its properties.
Hope it helps.
  댓글 수: 1
Mehwish Ahmed
Mehwish Ahmed 2018년 9월 18일
Thanks for the quick response!
The thing is that in my model, there is an initial priority assigned with some random distribution. And the current time in system is calculated with the difference between the attribute of creation time and the current simulation time (now in a simulink function).
The matlab function (in a simulink function) I was talking about which determines whether an entity should be released or not, is computed whenever a demand is generated. I did this by entering the simulink function in the event tab whenever a demand is generated. The matlab/simulink function works as a control in the entity input switch.
I want that whenever the pickup function is computed, the new values of the priority and the time in system are used that are updated with a frequency in some computation block. However, now I get the error of a loop:
- Input data dependency violation due to function-call or action subsystems. See Subsystem Examples in the Simulink library for valid and invalid examples of function-call and action subsystems Component:Simulink | Category:Model error
- Input ports (1, 2) of 'Model8V9/Enabled Subsystem' are involved in the loop Component:Simulink | Category:Model error
- Input ports (5, 6, 7, 8, 10) of 'Model8V9/Pick up' are involved in the loop
It is difficult to explain but I hope you understand :) Thanks!

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

카테고리

Help CenterFile Exchange에서 Discrete-Event Simulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by