summaryrefslogtreecommitdiff
path: root/2279/CH2/EX2.3/Ex2_3.sce
diff options
context:
space:
mode:
Diffstat (limited to '2279/CH2/EX2.3/Ex2_3.sce')
-rw-r--r--2279/CH2/EX2.3/Ex2_3.sce25
1 files changed, 25 insertions, 0 deletions
diff --git a/2279/CH2/EX2.3/Ex2_3.sce b/2279/CH2/EX2.3/Ex2_3.sce
new file mode 100644
index 000000000..2168406b9
--- /dev/null
+++ b/2279/CH2/EX2.3/Ex2_3.sce
@@ -0,0 +1,25 @@
+//Example 2.3
+clear
+clc
+clf
+n=-20:1:20;
+x=[zeros(1,19),1,1,2,3,4,0.5, zeros(1,16)];
+subplot(3,1,1);
+plot(n,x,".");
+xtitle("x(n) vs n","n","x(n)");
+subplot(3,1,2);
+plot(n+3,x,'.');
+xtitle("x(n-3) vs n","n","x(n-3)");
+subplot(3,1,3);
+plot(n-2,x,'.');
+xtitle("x(n+2) vs n","n","x(n+2)");
+figure(1)
+subplot(3,1,1);
+plot(-n,x,'.');
+xtitle("x(-n) vs n","n","x(-n)");
+subplot(3,1,2);
+plot(-n+2,x,'.');
+xtitle("x(-n+2) vs n","n","x(-n+2)");
+subplot(3,1,3)
+plot(-n-3,x,'.')
+xtitle("x(-n-3) vs n","n","x(-n-3)");