blob: cb718eea26d8eb980587ab6c06f3c1a2cea481a6 (
plain)
1
2
3
4
5
6
7
8
9
|
clc;
clear;
alpha=-0.5 //attenuation in dB/km
I_t=2*10^-6 //input power in W
I_o=1.5*10^-3 //output power in W
//calculation
L=-(10/0.5)*log10(I_t/I_o)
mprintf("The length of the fibre is = %2.1f km.",L)
|