clear; close all % % Tests your decay function % tc = 0.5; t = 0:0.01:5*tc; omega = 2; figure set(gcf,'PaperOrientation','portrait'); subplot(4,1,1); plot(t,decay(t,0,[tc omega])); grid on title('Decay function'); ylabel('f(t)'); subplot(4,1,2); plot(t,decay(t,1,[tc omega])); grid on; ylabel('df/dt') subplot(4,1,3); plot(t,decay(t,2,[tc omega])); grid on; ylabel('d^2f/dt^2') subplot(4,1,4); plot(t,decay(t,3,[tc omega])); grid on; ylabel('d^3f/dt^3')