Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %%Part 1 Commutative
- T=0.1;
- t1=-2:T:-1-T;
- t2=-1:T:0;t3=T:T:1;
- t4=1+T:T:2;
- t=[t1 t2 t3 t4];
- tf1=[t2 t3];
- tf2=[t2 t3];
- f1=[ones(1,11) ones(1,10)];
- f2=[t2+1 1-t3];
- f12=T*conv(f1,f2);
- f21=T*conv(f2,f1);
- figure(1)
- plot(t, f12)
- grid on;
- title('Commutative')
- ylabel('pulse(t)*triangle(t)')
- xlabel('Time t')
- figure(2)
- plot(t, f21)
- grid on;
- title('Commutative')
- ylabel('triangle(t)*pulse(t)')
- xlabel('Time t')
- figure(3)
- plot(tf1, f1)
- grid on;
- title('Pulse')
- ylabel('pulse(t)')
- xlabel('Time t')
- axis([-1.1 1.1 0 1.1]);
- figure(4)
- plot(tf2, f2)
- grid on;
- title('Triangle')
- ylabel('triangle(t)')
- xlabel('Time t')
- %%Part 2
- %%a)
- %%
- num=[1 5];
- den=[1 4 3];
- t=0:0.1:5;
- h=impulse(num,den,t);
- figure(5)
- plot(t,h)
- grid on;
- title('Impulse of function')
- ylabel('H(s)')
- xlabel('Time t')
- %%B)
- f=ones(1,length(t));
- t=0:0.1:10;
- figure(6);
- plot(t, conv(f,h))
- grid on;
- title('Step Response')
- ylabel('Conv(f,h)')
- xlabel('Time t')
- %%C)
- t=0:0.1:5;
- f=sin(2*t);
- t=0:0.1:10;
- figure(7);
- plot(t,conv(f,h))
- grid on;
- title('System zero-state response using sin(2t)')
- ylabel('conv(sin(2t),h)')
- xlabel('Time t')
Add Comment
Please, Sign In to add comment