tic
data = transferFunction(oscilloscope,functiongenerator,f_start,f_stop,amplitude,n_steps);
toc
figure
ax(1)=subplot(2,1,1);
semilogx(data.frequency,20*log10(data.magnitude));
legend('Magnitude')
ylabel('Magnitude [dB]')
xlabel('Frequency [Hz]')
ax(2)=subplot(2,1,2);
semilogx(data.frequency,data.phase);
legend('Phase')
ylabel('Phase [rad]')
xlabel('Frequency [Hz]')
linkaxes(ax,'x')
arrayfun(@(x) set(x,{'TickLabelInterpreter','XGrid','YGrid','fontsize'},{'latex','on','on',12}),ax)
%%limit in quarter pi
yscale = 4;
ymax = 4;
ymin = -4;
ystep = 1;
numberticks = (ymin:ystep:ymax)*(pi/yscale);
latexticks = {'$-\pi$','$-\frac{3}{4}\pi$','$-\frac{1}{2}\pi$','$-\frac{1}{4}\pi$','$0$','$\frac{1}{4}\pi$','$\frac{1}{2}\pi$','$\frac{3}{4}\pi$','$\pi$'};
set(ax(2), {'YLim','YTick','YTickLabel'},{[-pi,pi],numberticks,latexticks});