Matlab Programme For Calculating HKL Values: All All 'Enter The Factor' 'Enter The Values of 2 Theta'
Matlab Programme For Calculating HKL Values: All All 'Enter The Factor' 'Enter The Values of 2 Theta'
Matlab Programme For Calculating HKL Values: All All 'Enter The Factor' 'Enter The Values of 2 Theta'
clc;
close all;
clear all;
factor=input('enter the factor');
lamda=1.54;
two_theta=input('enter the values of 2*theta');
theta=two_theta/2
sintheta=sin(theta*pi/180)
a1=power(sintheta,2)
min=min(a1);
a=factor*a1/min
d_sqr=a*power(lamda,2)./(4*a1)
avg=mean(d_sqr);
d=sqrt(avg);
display(d);
a2=uint8(a)
k=1;count=0;
[n,m]=size(a2);
temp=zeros(size(a2));
for i=1:m
count=0;
for j=1:k
if(a2(i)==temp(j));
count=1;
end
end
if(count==0)
temp(k)=a2(i);
k=k+1;
end
end
display(temp)
[p,q]=size(temp);
for i=1:q
srt=uint8(sqrt(temp(i)));
N=temp(i);
display(N);
for h=0:srt
for k=0:srt
for l=0:srt
if(temp(i)==power(h,2)+power(k,2)+power(l,2))
display(h)
display(k)
display(l)
end
end
end
end
D_sqr =
41.8597 41.8597 41.8597 41.8597 41.8597 41.8597 41.8597 41.8597 41.8597 41.8597
41.8597
D = 6.4699
A2 = 4
4 5 5 5 10 11 11 15 16 16
Temp = 4
5 10 11 15 16
HKL Values
N=4
h= 0k= 0l=2
h= 0k=2l=0
h=2k=0l=0
N=5
h=0k=1l=2
h=0k=2l=1
h =1 k = 0 l = 2
h = 1 k = 2 l =0
h = 2 k = 0 l =1
h = 2 k = 1l =0
N=10
h = 0 k = 1 l =3
h =0 k = 3 l =1
h=1k=0l=3
h=1k=3l=0
h=3k=0l=1
h = 3 k = 1 l =0
h=1k=3l=0
h=3k=0l=1
h = 3 k = 1 l =0
N=11
h = 1 k =1 l =3
h =1 k =3 l = 1
h =3 k =1 l = 1
N=16
h = 0 k =0 l =4
h = 0 k =4l = 0
h = 4 k =0 l = 0
sintheta =
0.3780 ,0.3814, 0.3896, 0.3906 ,0.4053,0.4067,0.4101,0.4106,0.4115,0.4196 ,0.4202, 0.4281
,0.4531,0.4773,0.4871,0.4959
a1 =
0.1429 0.1455 0.1518 0.1525 0.1643 0.1654 0.1682 0.1686 0.1693 0.1761 0.1766 0.1833 0.2053 0.2278
0.2373 0.2459
a=
4.0000 4.0721 4.2494 4.2704 4.5986 4.6312 4.7077 4.7187 4.7407 4.9291 4.9440 5.1316 5.7462
6.3779 6.6421 6.884
d_sqr =
16.5979 16.5979 16.5979 16.5979 16.5979 16.5979 16.5979 16.5979 16.5979 16.5979 16.5979
16.5979 16.5979 16.5979 16.5979 16.5979
d = 4.0740
a2 = 4 4 4 4 5 5 5 5 5 5 5 5 6 6 7 7
temp = 4 5 6 0 0 0 0 0 0 0 0 0 0
HKL Values
N=4
h= 0k= 0l=2
h= 0k=2l=0
h=2k=0l=0
N= 5
h= 0k=1 l=2
h= 0k=2 l=1
h=1 k=0 l=2
h = 1 k = 2 l =0
h = 2 k= 0 l =1
h =2 k= 1 l = 0
N=6
h=1 k=1 l=2
h=2 k=1 l=1
h=1 k=2 l=1
HKL Values
N=3
h= 1 k =1 l
=1
N=4
h= 0k= 0l=
2
h= 0k=2l=
0
h=2k=0l=0
N=5
h=0k=1l=2
h=0k=2l=1
h =1 k = 0 l = 2
h = 1 k = 2 l =0
h = 2 k = 0 l =1
h = 2 k = 1l =0
N=11
h = 1 k =1 l
=3
h =1 k =3 l =
1
h =3 k =1 l =
1
N=14
h = 1 k =2 l =3
h = 1 k =3l = 2
h = 2 k =1 l = 3
h = 2 k = 3 l= 1
h= 3 k= 1 l= 2
h = 3 k= 2 l= 1