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 /2294/CH1/EX1.7 | |
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 '2294/CH1/EX1.7')
-rwxr-xr-x | 2294/CH1/EX1.7/EX1_7.sce | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/2294/CH1/EX1.7/EX1_7.sce b/2294/CH1/EX1.7/EX1_7.sce new file mode 100755 index 000000000..b79864a65 --- /dev/null +++ b/2294/CH1/EX1.7/EX1_7.sce @@ -0,0 +1,44 @@ +//Example 1_7_<i>
+//Sketch the following signal.
+clc;
+clear all;
+t=-5:1/1000:5;
+for i=1:length(t)
+ if t(i)>1 then
+ x(i)=0;
+ else
+ x(i)=1;
+ end
+end
+f=scf(0);
+plot2d(t,x);
+plot(t,x,'red');
+xtitle('Required figure','t','x(t)');
+xgrid();
+xs2jpg(0, 'problem1_7_i-plot.jpg');
+//Example 1_7_<ii>
+//Sketch the following signal.
+clc;
+t=-5:1/1000:5;
+for i=1:length(t)
+ if t(i)<1 then
+ x(i)=0;
+ else
+ x(i)=1;
+ end
+end
+for i=1:length(t)
+ x1(i)=-2*x(i);
+end
+//figure
+f=scf(0);
+plot2d(t,x);
+xtitle('required figure','t','x(t)');
+xs2jpg(0, 'problem1.7.2-plot-a.jpg');
+//figure
+f=scf(1);
+plot2d(t,x1);
+plot(t,x1,'blue');
+xtitle('Required figure','t','x1(t)');
+xs2jpg(1, 'problem1.7.2-plot-b.jpg');
+
|