Figures appear on wrong spot in Matlab Livescript

20 views (last 30 days)
I'm using a Matlab Livescript with different text headers (text sections). In each section, Matlab is supposed to plot some figures (in each section one figure is plotted by an external function, which calculates some variables and plot them).
When I run the script, the figures supposed to be in the 1.section really appear in the 1.section at the beginning of the code run. But when the execution proceeds to the 2.section, the figures of the 1.section appear in the 2.section. The same happens with the figures from the 2.section, etc.
In the end all the figures are in wrong order and appear in the wrong section (but no figure is missing.)
What goes wrong here?

Answers (1)

Marcel345614
Marcel345614 on 8 Jul 2021
I tried adding
pause(1)
at the end of each section and this solved the problem.
But stil this is not the most satisfying solution.

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!