blob: 7dba1ca7c9cd7f6a43608b277af38f21c303a64d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
//Ex1_5
//given
//page no 11
clc;
clear;
c=3*10^8;
disp('Solution (i) is ');
ri=1.5;//refractive index
u=830// in nm
l=u/ri; //in nm
printf("\n Wavelength is %0.0f nm \n",l);
disp('Solution (ii) is ');
l=round(l); // rounding to nearest integer
f=c/(l*10^-9)*10^-12; //in THz
printf("\n frequency is %0.0f THz\n",f);
disp('Solution (iii) is ');
f=round(f); // rounding to nearest integer
v=l*10^-9*f*10^12; //in m/s
mprintf("\n phase velocity is %.3e m/s\n",v);//answer is getting rounding off due to larger calculation
|