Code covered by the BSD License
clear all; close all; clc; fs=300; t=-5:1/fs:5; X1=tripuls(t,0.2); subplot(1,2,1); plot(t,X1) axis([-0.2 0.2 -1.2 1.2]); xlabel('time'); ylabel('amplitude'); title('continuous triangular pulse') display(x1); subplot(1,2,2); stem(t,X1) axis([-0.2 0.2 -1.2 1.2]); xlabel('number of samples'); ylabel('amplitude'); title('discrete triangular pulse') display(x1);
Contact us