Each of your
and similar is creating a new axes and making it the default axes. The default position is used for the axes. You are not setting the axes color to 'none' so the new axes is "on top of" the old and hiding it.
A better structure:
h_figure_1 = figure(1);
h_tabgroup = uitabgroup(h_figure_1);
tab1 = uitab(h_tabgroup,'Title','y relative to z');
tab2 = uitab(h_tabgroup,'Title','y relative to z and n');
tab1_axes = axes('parent', tab1);
hold(tab1_axes, 'on');
tab2_axes1 = subplot(tab2, 2, 1, 1);
hold(tab2_axes1, 'on');
tab2_axes2 = sbplot(tab2, 2, 1, 2);
hold(tab2_axes2, 'on');
while true
plot(tab1_axes, x, y/z);
plot(tab2_axes1, x, y/(z+n));
plot(tab2_axes2, x, y/n);
if input('Run again? 1 - yes, 0 - no') ~= 1; break; end
end
Best Answer