a1=[46 140.6 137 205.8 195 267.5]
c1=sort(a1)
b1=[0.75 0.89 0.22]
k1=length(a1)
for m=1:k1-1
y=0;
for n=1:k1/2
if c1(m)>=a1(2*n-1)&c1(m+1)<=a1(2*n)
y=b1(n)+y;
f1(m+1)=y;
f1(1)=f1(2);
end
end
end
H1(1)=10*f1(1)
for i=1:k1-1
H1(i+1)=H1(i)+(c1(i+1)-c1(i))*f1(i+1)
end
plot(H1,c1);
str1=strcat('(',num2str(H1(1)),',',num2str(c1(1)),')');
m=length(H1)
str2=strcat('(',num2str(H1(m)),',',num2str(c1(m)),')');
text(H1(1)-5,c1(1)-10,str1);
text(H1(m)-30,c1(m)+10,str2);
hold on
plot(H1(1),c1(1),'k*');
plot(H1(m),c1(m),'k*');
hold off