参考代码:
x=[1,2,3,4,5,6,8];y=[269/288,40/288,33/288,6/288,3/288,2/288,1/288];loglog(x,y,'.')c=[ones(length(x),1) log10(x(:))]\log10(y(:));xi=1:10;yi=10.^(c(1)+c(2)*log10(xi));hold onloglog(xi,yi,'r-')legend('原始数据','拟合数据')xlabel x; ylabel y