Beruflich Dokumente
Kultur Dokumente
m 1 of 2
clc;
clear all;
n = str2num(answer{1});
d = str2num(answer{2});
%%
for k=1:n
M(k)=(1/3)*((10*((k)^3))+15*((k)^2)+11*k+3); % Total number of atoms
N(k)=10*((k)^2)+2; % Total number of atoms on surface
sur(k)=N(k)*100/M(k); % Percentage surface
d(k)=2*k+1; % Calculation of Diameter
end
for i=2:n
if(sur(i-1)-sur(i)<=1)
shell=i;
break
else
shell=0;
end
end
%%Plot
plot(d,100-sur,'r-o');
hold on
plot(d,sur,'-o');
hold off
if(shell>0)
str=sprintf('The number of shell after which percentage of atom in Bulk/on surface \n
between two consecutive shell is less than 1 = %d' , shell);
text(5,95,str, 'FontSize', 10);
end