当前位置:网站首页>Data Fitting Methods Application of MATLAB in Mathematical Modeling (Second Edition)
Data Fitting Methods Application of MATLAB in Mathematical Modeling (Second Edition)
2022-08-09 17:17:00 【YuNlear】
Data fitting method
Application of MATLAB in Mathematical Modeling (Second Edition)
Polynomial Fits
polyfit(X,Y,N)X,Y are the data to be fitted, and N is the highest number of fittings
Returns a vector P of polynomial coefficients.
polyval(P,X)P is the polynomial coefficient vector, X is the required data point,
Returns the value of Y corresponding to X.
Specified function fit
f=fittype('function','independent','independent variable','coefficients',{'coefficient1','coefficient2',...})The fittype function is used to customize the fitting function
fit(x,y,f)The fit function uses a custom function f to fit x, y.
Curve Fitting Toolbox
Curve Fitting Tool
Click Start->Toolboxes->Curve Fitting->Curve Fitting Tool(cftool) to open
You can also enter the cftool command on the command line to open
Example 1 Population Prediction Model
The topic is omitted
%syms tY = [33815 33981 34004 34165 34212 34327 34344 34458 34498 34476 34483 34488 34513 34497 34511 34520 34507 34509 34521 34513 34515 34517 34519 34519 34521 34521 34523 34525 34525 34527];X = [1:30];x = [1:30];y = [1:30];%f = fittype('1/(a+b*exp(-t))','independent','t','coefficient',{'a','b'});%cfun = fit(X,Y,f);%Yi = cfun(X);%plot(X,Y,'r*',X,Yi,'b');for t = 1:30x(t) = exp(-t);y(t) = 1/(Y(1,t));endf = polyfit(x,y,1);for t = 1:30Yj(t)=1/(f(2)+f(1)*exp(-t));endplot(X,Y,'r*',X,Yj,'b');Example 2 Determination of membrane permeable membrane
The topic is omitted
x = lsqcurvefit(fun,x0,xdata,ydata,lb,ub,options)lsqcurvefit
Solving nonlinear curve fitting (data fitting) problems with least squares
For details, see the linkhttps://ww2.mathworks.cn/help/optim/ug/lsqcurvefit.html#responsive_offcanvas
t = [100:100:1000];Cbt = 0.001.*[4.54 4.99 5.35 5.65 5.90 6.10 6.26 6.39 6.50 6.59];x0 = [0.2,0.05,0.05];%a,b,K initial valueopts = optimset('lsqcurvefit');opts = optimset(opts,'PrecondBandWidth',0);x = lsqcurvefit('curvefun',x0,t,Cbt,[],[],opts);f = curvefun(x,t);plot(t,Cbt,'o',t,f,'b');边栏推荐
- hugging face tutorial - Chinese translation - preprocessing
- Postgraduate Work Weekly
- Markdown 文档生成 PDF
- 【工具使用】Modbus Slave软件使用详解
- hugging face tutorial - Chinese translation - share a model
- 【原理+源码详细解读】从Transformer到ViT
- 堆(heap)系列_0x02:堆的前世今生(WinDbg+Visual Studio汇编)
- 交叉编译 OpenSSL
- [Deep Learning] SVM solves the linear inseparable situation (8)
- 【知识分享】Modbus通信协议详解
猜你喜欢
随机推荐
永磁同步电机电位器调速及数码管实时显示
Vitis部分实验记录
堆(heap)系列_0x06:NT全局标志和gflags.exe一页纸
【力扣】11. 盛最多水的容器
【力扣】593. 有效的正方形
PatchEmbed代码讲解记录
MNIST数据集的训练(内附完整代码及其注释)
【Postgraduate Work Weekly】(Week 8)
go语言基础学习(一起学习go语言)
【工具使用】Modbus Poll软件使用详解
Face recognition sample code analysis (2) - face recognition analysis
【工具使用】Keil5软件使用-进阶工程配置篇
【力扣】1995. 统计特殊四元组
灰色关联度矩阵——MATLAB在数学建模中的应用
【深度学习】归一化(十一)
Candide3人脸动画模型
【学习笔记】win10报0xc0000221错误无法开机
OpenCV下载、安装以及使用
Vim实用技巧_0.vim - introduction
蓝桥杯嵌入式备赛









