Run a section of code, pause, close figures and proceed to next section
조회 수: 6(최근 30일)
Hello, I am trying to beautify my code and it would be great if I could make my code run as described in the question. My most recent attempt looked something like this:
X = [...];
Y = [...];
h(1) = figure
close figure 1
Not all sections have figures however (some only display text in the command window) but for some reason, when I would hit a key to advance past the pause, the figure would close and no code would be displayed from the next section. The run button in the editor tool bar said run (not pause) but when I clicked on it, the entire code would not run. I would then close matlab and would get a message that says something like matlab is running something and if you close now whatever it is doing would be incomplete.
Basically, I would greatly appreciate it if any of you know how to pause code at the end of a section then, upon some input, close any figures at the end of that section and advance to the next section. Thanks for your time!
Iddo Weiner 2017년 1월 29일
Have you tried running sections (mark a section by starting it with %%+enter) separately with ctrl+enter?
then you can plant:
at the end of the section and basically you get what you're looking for, if I understand you correctly..