Problem: how to get datas from integrator block in simulink

2 次查看(过去 30 天)
heya everyone
im new to this community, so if i didn't write in a proper way pls forgive me :)
My real problem is animation, because i have simulink model, which i have to simulate via GUI, and i made it and it works perfectly, but in addition i want to create animation from that simulation.
My real task is to animate, two connected containers with liquid, and how they works when you simulate whole model, i completed model and when i simulate it works, but of course it represents results in one graph
So basicly at the beginning i drew two connected containers, and now i have to add animation to that, so basicly when i hit "Simulate" button, that everyone can see how it works
And now i'm wondering is it possible to get datas from integrators bcs in integrators are stored data of water level which i think i can use for area, set etc. functions, and with refreshdata i can easily get animation...
Thank you in advance, and i hope that you understand what is my problem, if you need more info pls write it here, or email me at:

采纳的回答

Fangjun Jiang
Fangjun Jiang 2011-8-18
You can always connect the outport of the Integrator block to a Outport block or a To Workspace block to record the data of the Integrator block. Trying to have a third-party tool to read the output of the Integrator block while the simulation is running might be a challenge.
There are a few demo models that have animation, such as sldemo_dblcart1.mdl and penddemo. Run the model to see the effect. Both are done using a S-function.
I think the easiest way is to use the Gauges Blockset if you happen to have this Toolbox.
  1 个评论
Kostbone
Kostbone 2011-8-19
it works when i connect "to workspace" block, and it seems it is easiest way to collect data, ty for answer

请先登录,再进行评论。

更多回答(2 个)

Kaustubha Govind
Kaustubha Govind 2011-8-18
On the Integrator block dialog, there is an option called "Show state port" that you can select to output the current state. Does this answer your question?
  2 个评论
Kostbone
Kostbone 2011-8-19
ty for answer, but when i hit show state port and simulate, nothing happens, so do i have to connect another block to output of integrator to collect that "datas" or something like that
Kaustubha Govind
Kaustubha Govind 2011-8-19
Yes. It looks like Fangjun answered your question correctly. I think I misinterpreted your question. :)

请先登录,再进行评论。


Guy Rouleau
Guy Rouleau 2011-8-18
My favorite way to send data each time step from a model to a GUI is with an event listener. See those links:
  1 个评论
Kostbone
Kostbone 2011-8-19
ty for answer, this might be useful later, but atm is way to hard for me to implement it easily :)

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Simulation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by