The following would work if the functions you are using plotted one figure each: call subplot
right before each function that produces a graphic output. It is kind of straightforward from the manual, subplot(m,n,p)
splits the figure into a grid of m x n graphics and draws the p-th one. However, as pointed by @hbaderts, freqz
produces a subplot of its own, so you would need to rearrange it to include the upcoming output of grpdelay
.
This is how you could do it, as per the workaround proposed in this thread (see it for the more general solution).
freqz(sos);
h = get(gcf, 'children');
fig2=figure;
figure(fig2)
g=subplot(3,1,1)
set(h(1), 'pos', get(g, 'pos'))
figure(fig2)
g=subplot(3,1,2)
set(h(2), 'pos', get(g, 'pos'))
close
g=subplot(3,1,3)
grpdelay(sos)