%% Block MATLAB Execution While Nonmodal Dialog Box Displays
% Prevent program execution from continuing until the user responds to a nonmodal dialog box.
% Create a line plot in a figure.

f = figure;
ax = axes(f);
plot(ax,1:10)

%
% Display a message dialog box and block MATLAB® program execution until the user to responds to it.

uiwait(msgbox('Operation Completed','Success'))

%
%
% Update the plot when the user clicks OK on the dialog box or closes it.

plot(ax,(1:10).^4)

% Copyright 2019 The MathWorks, Inc.