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/CH3/EX3.21/EX3_21.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/CH3/EX3.21/EX3_21.sce')
-rwxr-xr-x | 2294/CH3/EX3.21/EX3_21.sce | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/2294/CH3/EX3.21/EX3_21.sce b/2294/CH3/EX3.21/EX3_21.sce new file mode 100755 index 000000000..62f6d131b --- /dev/null +++ b/2294/CH3/EX3.21/EX3_21.sce @@ -0,0 +1,31 @@ +//Example 3.21
+//Determine the response of the below relaxed system.
+clc;
+close;
+ n=-10:.01:10;
+ for i=1:length(n)
+ if n(i)<0 then
+ h(i)=0;x(i)=0;
+ else
+ h(i)=(1/3)^n(i);
+ x(i)=2^n(i);
+ end
+ end
+ y=convol(h,x);
+ //figure
+ f=scf(0);
+ plot(n,h,'black');
+ xtitle('input response1','n','h(n)');
+ xs2jpg(0, 'problem29-plot-a.jpg');
+// figure
+f=scf(1);
+ plot(n,x,'red');
+ xtitle('input response2','n','x(n)');
+ xs2jpg(1, 'problem29-plot-b.jpg');
+// figure
+f=scf(2);
+ n1=-20:.01:20;
+ plot(n1,y,'green');
+ xtitle('output response','n','y(n)');
+ xs2jpg(2, 'problem29-plot-c.jpg');
+
|