function weibull() %alpha: Shape parameter %beta: Scale parameter x=repmat(linspace(0.05,7),[100,1]); alpha=x'; for beta=1:7 figure f=(alpha/beta).*(x/beta).^(alpha-1).*exp(-(x./beta).^alpha); subplot(2,1,1) surf(x,alpha,f) axis([0 7 0 7 0 2]) view(3) grid on g1=(1/beta).*(x/beta).^(1-1).*exp(-(x./beta).^1); g2=(3/beta).*(x/beta).^(3-1).*exp(-(x./beta).^3); g3=(5/beta).*(x/beta).^(5-1).*exp(-(x./beta).^5); g4=(7/beta).*(x/beta).^(7-1).*exp(-(x./beta).^7); subplot(2,1,2) plot(x,g1,'bo') hold on plot(x,g2,'b*') plot(x,g3,'b+') plot(x,g4,'bx') grid on axis([0 7 0 2]) end