Save figure handle globally in Simulink

1 view (last 30 days)
Hello guys,
i'm building a simulation with 2 plots in total. Both plots need to be refreshed (within a Matlab Function Block) with every new scan of a sensor incoming. Because i dont want to close and rebuild both plots in every Scan, i want to save both figure handles for the next iteration, so i can just clear them and plot the new data. My Question is: How can i save the figure handles globally, so i can work with them in the next call of the Matlab Function Block?
I hope you can help me.

Accepted Answer

Ameer Hamza
Ameer Hamza on 26 Nov 2020
That is not the current way to update handles from Simulink. I am not sure if it is even possible. Even if it is possible, it will be a very inefficient approach.
You need to use event-handles to create plots as shown in this example here: https://blogs.mathworks.com/simulink/2013/01/25/accessing-block-data-during-a-simulation/.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!