summaryrefslogtreecommitdiff
path: root/2279/CH1/EX1.4/Ex1_4.sce
diff options
context:
space:
mode:
Diffstat (limited to '2279/CH1/EX1.4/Ex1_4.sce')
-rw-r--r--2279/CH1/EX1.4/Ex1_4.sce29
1 files changed, 29 insertions, 0 deletions
diff --git a/2279/CH1/EX1.4/Ex1_4.sce b/2279/CH1/EX1.4/Ex1_4.sce
new file mode 100644
index 000000000..1f689f557
--- /dev/null
+++ b/2279/CH1/EX1.4/Ex1_4.sce
@@ -0,0 +1,29 @@
+clear
+clf
+clc
+t=-20:0.01:20;
+for i=1:length(t)
+ if t(i)>0 then
+ x1(i)=0.5;
+ else
+ x1(i)=-0.5;
+ end
+end
+subplot(3,1,1)
+plot(t,x1);
+xtitle("x1(t)=-0.5 for t<0 and x1(t)=0.5 for t>0","time","amplitude");
+xgrid(5);
+subplot(3,1,2)
+for i=1:length(t)
+ x2(i)=-t(i);
+end
+plot(t,x2);
+xtitle("x2(t)=-t for all t","time","amplitude");
+xgrid(5);
+subplot(3,1,3)
+for i=1:length(t)
+ x3(i)=t(i).^2;
+end
+plot(t,x3);
+xtitle("x3(t)=t^2 for all t","time","amplitude");
+xgrid(5);