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 /162/CH2 | |
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 '162/CH2')
-rwxr-xr-x | 162/CH2/EX2.2/example22.png | bin | 0 -> 9888 bytes | |||
-rwxr-xr-x | 162/CH2/EX2.2/example22.sce | 36 |
2 files changed, 36 insertions, 0 deletions
diff --git a/162/CH2/EX2.2/example22.png b/162/CH2/EX2.2/example22.png Binary files differnew file mode 100755 index 000000000..0b94c052e --- /dev/null +++ b/162/CH2/EX2.2/example22.png diff --git a/162/CH2/EX2.2/example22.sce b/162/CH2/EX2.2/example22.sce new file mode 100755 index 000000000..03deaecb4 --- /dev/null +++ b/162/CH2/EX2.2/example22.sce @@ -0,0 +1,36 @@ +clear ;
+close;
+clc;
+T0=4;
+t=.01:0.01:2*T0;
+t_temp=0.01:0.01:T0/2;
+s=length(t)/length(t_temp);
+x=[];
+for i=1:s
+ if modulo(i,2)==0 then
+ x=[x zeros(1,length(t_temp))];
+ else
+ x=[x ones(1,length(t_temp))];
+ end
+end
+a=gca();
+plot(t,x)
+poly1=a.children.children;
+poly1.thickness=3;
+poly1.foreground=2;
+xtitle('x(t)','t')
+w0=%pi/2;
+for k=1:5
+ cc(k,:)=exp(-%i*k*w0*t);
+ ck(k)=x*cc(k,:)'/length(t);
+ if abs(ck(k))<0.01 then
+ ck(k)=0;
+ else if imag(ck(k))<0.01 then
+ ck(k)=real(ck(k));
+ end
+ end
+
+end
+a=2*real(ck);
+b=2*imag(ck);
+disp(b,'bn=');
\ No newline at end of file |