⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sos2.m

📁 文件是编辑好的m文件
💻 M
字号:
figure('pos',[100,100,300,200],'color','w');
axes('pos',[.15,.1,.8,.8]);
%t=[0,10,20,40,60,80,100,150,200,300,400,500];
%h=[0,-0.5,9.5,18,33,45,55,63,78,86,95,98];
%load d:\yzpta\stepdata;st=step_data';t=st(1,:);h=st(2,:);
load invdata2;[r,tm]=size(y);
t=y(1,[1:10:200,200:100:tm]);h=y(2,[1:10:200,200:100:tm]);%gg=0:.1:max(t);
%h(2:4)=[0.064 0.0961 0.1265];yy=spline(t,h,gg);save d:\yzpta\invdata2 y
tt=t;hh=h;
x0=[1,12,2,24,3];opti=optimset('fminbnd');val=optimset(opti,'MaxFunEvals',3000);
x=lsqcurvefit('onedt2',x0,tt,hh,0,100,val)
y=onedt2(x,tt);err=sum((hh-y).^2)
save  fitdata1 t h tt y x;
plot(t,h,'b*',tt,y,'k');grid;axis([0 100 -0.1 0.05]);
set(gca,'ytick',[-.1:0.05:.05],'ytickmode','manual');%pause;
%plot(tt,hh-y);grid;maxerr=max(abs(hh-y));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -