当前位置:网站首页>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');
边栏推荐
猜你喜欢
Vim实用技巧_3.可视模式和命令模式
堆(heap)系列_0x03:堆块 + malloc/new底层 + LFH(WinDbg分析)
hugging face tutorial - Chinese translation - preprocessing
【研究生工作周报】(第十周)
用广搜和动态规划写个路径规划程序
[Deep Learning] SVM solves the linear inseparable situation (8)
【Postgraduate Work Weekly】(Week 12)
OpenCV下载、安装以及使用
【知识分享】知识链路-Modbus通信知识链路
【力扣】11. 盛最多水的容器
随机推荐
NLP-Reading Comprehension Task Learning Summary Overview
蓝桥杯嵌入式备赛
大唐杯5G练习题(二)
QNX 7.1 交叉编译 boost 1.76
【研究生工作周报】(第八周)
Vim实用技巧_7.模式匹配和查找
【工具使用】Modscan32软件使用详解
交叉编译 CURL
【研究生工作周报】(第十周)
Stetman读paper小记:Backdoor Learning: A Survey(Yiming Li, Yong Jiang, Zhifeng Li, Shu-Tao Xia)
Vim实用技巧_5.在文件间和文件内快速移动
【原理+源码详细解读】从Transformer到ViT
抱抱脸(hugging face)教程-中文翻译-使用 Tokenizers 的 tokenizers
VGG pytorch实现
【力扣】1995. 统计特殊四元组
机器学习的基本术语
ConvNext笔记
ResNet 残差网络 一些粗略的理解
Visio画神经网络卷积层
SVM支持向量机——MATLAB在数学建模中的应用