summaryrefslogtreecommitdiff
path: root/3875/CH9/EX9.2/Ex9_2.sce
blob: 68d3e7d4ddfd3cd5fcecf466a86456feef1cfb22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
clc;
clear;
alpha=2.2 //attenuation of light in dB/km
L1=2 //distance in km
L2=6 //distance in km

//calculation
//Case(a):when distance is 2km
It_by_I0=10^-((alpha*L1)/10)
mprintf("\nThe fraction of intial intensity that will remain after 2km is = %1.3f\n",It_by_I0)

//Case(b):when distance is 6km
It_by_I0=10^-((alpha*L2)/10)
mprintf("\nThe fraction of intial intensity that will remain after 2km is = %1.3f",It_by_I0) //The answer varies due to round off error.