📄 untitled6.asv
字号:
close all;
t= [ 11.9270 15.7330 20.9000 60.0360
13.7500 13.5700 20.5990 98.2420
13.3890 13.2690 20.9200 40.3280
14.1800 13.5000 20.8700 88.7380
12.7180 13.3990 20.9600 44.3140
14.2700 13.2990 20.8800 96.3290
11.9570 13.3890 22.1920 89.1880
12.5480 13.5900 20.6290 81.3870];
t1=mean(t(1:8)),t2=mean(t(9:16)),t3=mean(t(17:24)),t4=mean(t(25:32)),
w=[2 3 4 6 8 12 16];w0=[2 4 8 16];
p0=[t4 t3 t2 t1];
p=[t4 (t3+t4)/2 t3 (t3+t2)/2 t2 (t2+t1)/2 t1];
plot(w0,p0,'r*');hold on;
% x=w;y=p;
% [a,s]=polyfit(x,y,4);a
% i=0.5:0.1:18;
% %p1=a(1)*i.^3+a(2)*i.^2+a(3)*i+a(4);
% p1=a(1)*i.^4+a(2)*i.^3+a(3)*i.^2+a(4)*i+a(5);
% plot(i,p1,'LineWidth',1.8)
x=[2 4 8 16];y=p0;
a0=[-1 1 -1];
options=optimset('fminsearch');
options.TolX=0.005;
options.Display='off';
a=fminsearch(@logg,a0,options,x,y);
a
i=1:0.1:3;
p1=-a(1).*log(a(2).*i)./i+a(3);
% plot(i,p1)
plot(i,p1,'LineWidth',1.8);
axis([1 32 0 max(p1)])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -