summaryrefslogtreecommitdiff
path: root/2294/CH4/EX4.4.2/EX4_4_2.sce
diff options
context:
space:
mode:
Diffstat (limited to '2294/CH4/EX4.4.2/EX4_4_2.sce')
-rwxr-xr-x2294/CH4/EX4.4.2/EX4_4_2.sce25
1 files changed, 25 insertions, 0 deletions
diff --git a/2294/CH4/EX4.4.2/EX4_4_2.sce b/2294/CH4/EX4.4.2/EX4_4_2.sce
new file mode 100755
index 000000000..245736d8a
--- /dev/null
+++ b/2294/CH4/EX4.4.2/EX4_4_2.sce
@@ -0,0 +1,25 @@
+//Example 4.4 <ii>
+//Find the step response of the following impulse response.
+clc;
+t=-1:.01:1;
+for i=1:length(t)
+ if t(i)==0 then
+ del1(i)=1;del2(i)=0;
+ elseif t(i)==1 then
+ del1(i)=0;del2(i)=1;
+ else
+ del1(i)=0;del2(i)=0;
+end
+h(i)=del1(i)-del2(i);
+if t(i)<0 then
+ u(i)=0;
+else
+ u(i)=1;
+end
+end
+s=convol(h,u);
+t1=-10:.05:10;
+f=scf(0);
+plot(t1,s,'red');
+xtitle('s[t]');
+xs2jpg(0, 'EX4_4_2-plot-a.jpg');