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 /2279/CH1 | |
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 '2279/CH1')
-rw-r--r-- | 2279/CH1/EX1.1/eg1_1.sce | 15 | ||||
-rwxr-xr-x | 2279/CH1/EX1.10/eg1_10.sce | 16 | ||||
-rwxr-xr-x | 2279/CH1/EX1.2/eg1_2.sce | 10 | ||||
-rwxr-xr-x | 2279/CH1/EX1.3/eg1_3.sce | 17 | ||||
-rwxr-xr-x | 2279/CH1/EX1.4/eg1_4.sce | 29 | ||||
-rwxr-xr-x | 2279/CH1/EX1.5/eg1_5.sce | 14 | ||||
-rw-r--r-- | 2279/CH1/EX1.6/eg1_6.sce | 22 | ||||
-rwxr-xr-x | 2279/CH1/EX1.7/eg1_7.sce | 11 | ||||
-rwxr-xr-x | 2279/CH1/EX1.8/eg1_8.sce | 5 |
9 files changed, 139 insertions, 0 deletions
diff --git a/2279/CH1/EX1.1/eg1_1.sce b/2279/CH1/EX1.1/eg1_1.sce new file mode 100644 index 000000000..d7ce7efa3 --- /dev/null +++ b/2279/CH1/EX1.1/eg1_1.sce @@ -0,0 +1,15 @@ + + + + + +clf
+clc
+clear
+t=[-20:0.01:20];
+for i=1:length(t)
+ x=2;
+end
+plot(t,x);
+xtitle("x(t)=2 for all t","time","amplitude");
+xgrid(5)
diff --git a/2279/CH1/EX1.10/eg1_10.sce b/2279/CH1/EX1.10/eg1_10.sce new file mode 100755 index 000000000..e9a16362a --- /dev/null +++ b/2279/CH1/EX1.10/eg1_10.sce @@ -0,0 +1,16 @@ +clear
+clf
+clc
+n=-20:1:20;
+for i=1:length(n)
+ x(i)=0.5;
+end
+subplot(2,1,1)
+plot(n,x,".");
+xtitle("x(n)=0.5 for all n","number of samples","amplitude");
+xgrid(5)
+y=0.5*x;
+subplot(2,1,2)
+plot(n,y,".");
+xtitle("y(n)=0.5*x(n) for all n","number of samples","amplitude");
+xgrid(5)
diff --git a/2279/CH1/EX1.2/eg1_2.sce b/2279/CH1/EX1.2/eg1_2.sce new file mode 100755 index 000000000..4757f4c1d --- /dev/null +++ b/2279/CH1/EX1.2/eg1_2.sce @@ -0,0 +1,10 @@ +clf
+clear
+clc
+t=[-20:0.01:20];
+for i=1:length(t)
+ x=2*t;
+end
+plot(t,x);
+xtitle("x(t)=2*t for all t","time","amplitude");
+xgrid(5)
diff --git a/2279/CH1/EX1.3/eg1_3.sce b/2279/CH1/EX1.3/eg1_3.sce new file mode 100755 index 000000000..90cc3f294 --- /dev/null +++ b/2279/CH1/EX1.3/eg1_3.sce @@ -0,0 +1,17 @@ +clc
+clear
+clf
+interval=input('enter the value of time interval T between two samples');
+t=(-20*interval):interval:(20*interval);
+for i=1:length(t)
+ if t(i)<0 then
+ x(i)=-1;
+ elseif t(i)>0 then
+ x(i)=1;
+ else
+ x(i)=0;
+ end
+end
+plot(t,x,".");
+xtitle("x(t)=1 for positive values of t..., x(t)=0 for t=0...., x(t)=-1 for negative values of t","time","amplitude");
+xgrid(5)
diff --git a/2279/CH1/EX1.4/eg1_4.sce b/2279/CH1/EX1.4/eg1_4.sce new file mode 100755 index 000000000..1f689f557 --- /dev/null +++ b/2279/CH1/EX1.4/eg1_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);
diff --git a/2279/CH1/EX1.5/eg1_5.sce b/2279/CH1/EX1.5/eg1_5.sce new file mode 100755 index 000000000..4f3bb9b34 --- /dev/null +++ b/2279/CH1/EX1.5/eg1_5.sce @@ -0,0 +1,14 @@ +clear
+clf
+clc
+n=-20:1:20;
+for i=1:length(n)
+ if n(i)>=0 then
+ x(i)=2;
+ else
+ x(i)=0;
+ end
+end
+plot(n,x,".");
+xtitle("x(n)=0 for n<0 and x(n)=2 for n>=0","number of samples","amplitude");
+xgrid(5)
diff --git a/2279/CH1/EX1.6/eg1_6.sce b/2279/CH1/EX1.6/eg1_6.sce new file mode 100644 index 000000000..d1201001c --- /dev/null +++ b/2279/CH1/EX1.6/eg1_6.sce @@ -0,0 +1,22 @@ +clc
+clear
+clf
+n1=-2:1:2;
+x1=-2:1:2;
+subplot(3,1,1)
+plot(n1,x1,".");
+xtitle("x1(n)","n","x1(n)");
+xgrid(5)
+n=-20:1:20;
+for i=1:length(n)
+ x2(i)=n(i);
+ x3(i)=2-n(i);
+end
+subplot(3,1,2);
+plot(n,x2,".");
+xtitle("x2(n)","n","x2(n)");
+xgrid(5);
+subplot(3,1,3);
+plot(n,x3,".");
+xtitle("x3(n)","n","x3(n)");
+xgrid(5);
diff --git a/2279/CH1/EX1.7/eg1_7.sce b/2279/CH1/EX1.7/eg1_7.sce new file mode 100755 index 000000000..d090d46d7 --- /dev/null +++ b/2279/CH1/EX1.7/eg1_7.sce @@ -0,0 +1,11 @@ +clear
+clf
+clc
+interval=input('enter the sampling interval');
+n=[-20:1:20];
+t=n*interval
+for i=1:length(t)
+ x(i)=2*t(i);
+end
+plot(t,x,".");
+xtitle("sampled function of x(t)=2*t for all t","number of samples","amplitude");
diff --git a/2279/CH1/EX1.8/eg1_8.sce b/2279/CH1/EX1.8/eg1_8.sce new file mode 100755 index 000000000..09c51e6d7 --- /dev/null +++ b/2279/CH1/EX1.8/eg1_8.sce @@ -0,0 +1,5 @@ +x=poly([-4 2 1],'t','c')
+a=horner(x,0)
+b=horner(x,-2)
+disp(a)
+disp(b)
|