summaryrefslogtreecommitdiff
path: root/199/CH8/EX8.3/Example_8_3.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /199/CH8/EX8.3/Example_8_3.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '199/CH8/EX8.3/Example_8_3.sce')
-rwxr-xr-x199/CH8/EX8.3/Example_8_3.sce46
1 files changed, 46 insertions, 0 deletions
diff --git a/199/CH8/EX8.3/Example_8_3.sce b/199/CH8/EX8.3/Example_8_3.sce
new file mode 100755
index 000000000..4277ba9cf
--- /dev/null
+++ b/199/CH8/EX8.3/Example_8_3.sce
@@ -0,0 +1,46 @@
+// Chapter8
+// Page.No-320, Figure.No-8.12
+// Example_8_3
+// Output frequencies
+// Given
+clear;clc;
+Vin=2; // Input voltage
+Fo1=2*10^3; // Output freq Fo when Vin=2V
+Fo2=1*10^3; // Output freq Fo/2 when Vin=2V
+printf("\n Output freq Fo is = %.f Hz \n",Fo1) // Result
+printf("\n Output freq Fo/2 is = %.f Hz \n",Fo2) // Result
+count=1;
+for i=1:50; //for 5 cycles
+if count<4;
+ v(i)=5;
+ else
+ v(i)=0;
+end
+if count<10
+ count=count+1;
+else
+ count=1;
+end
+end
+subplot(2,1,1);
+plot(v);
+title('Output Waveform');
+xlabel('t(microsec)');
+ylabel('Pulse freq output,Fo(V)');
+for i=1:50; //for 5 cycles
+if count<10;
+ v(i)=5;
+ else
+ v(i)=0;
+end
+if count<20
+ count=count+1;
+else
+ count=1;
+end
+end
+subplot(2,1,2);
+plot(v);
+title('Output Waveform');
+xlabel('t(microsec)');
+ylabel('Pulse freq output,Fo/2(V)'); \ No newline at end of file