summaryrefslogtreecommitdiff
path: root/62/CH1/EX1.21/ex_1_21.sce
diff options
context:
space:
mode:
Diffstat (limited to '62/CH1/EX1.21/ex_1_21.sce')
-rwxr-xr-x62/CH1/EX1.21/ex_1_21.sce22
1 files changed, 22 insertions, 0 deletions
diff --git a/62/CH1/EX1.21/ex_1_21.sce b/62/CH1/EX1.21/ex_1_21.sce
new file mode 100755
index 000000000..fd67e2668
--- /dev/null
+++ b/62/CH1/EX1.21/ex_1_21.sce
@@ -0,0 +1,22 @@
+//ex_21 to check if u(-t)={1 for t<0 and 0 for t>0}
+clear;
+clc;
+close;
+t=-10:1/100:10;
+for i = 1:(length(t))
+ if t(i)<0 then
+ x(i)=0
+ else
+ x(i)=1
+ end
+end
+figure
+a=gca();
+plot(t,x)
+xtitle('u(t)','t')
+a.data_bounds=[-10,-1;10,2];
+figure
+a=gca();
+plot(t,x($:-1:1))
+xtitle('u(-t)','t')
+a.data_bounds=[-10,-1;10,2];