diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /2294/CH4/EX4.4.2/EX4_4_2.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '2294/CH4/EX4.4.2/EX4_4_2.sce')
-rwxr-xr-x | 2294/CH4/EX4.4.2/EX4_4_2.sce | 25 |
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');
|