matlab线性拟合 |
您所在的位置:网站首页 › matlab中点线图 › matlab线性拟合 |
根据点求方程 使用Matlab进行拟合是图像处理中线条变换的一个重点内容,本文将详解Matlab中的直线拟合和曲线拟合用法。 关键函数: fittype Fit type for curve and surface fitTIng Syntax ffun = fittype(libname) ffun = fittype(expr) ffun = fittype({expr1,。..,exprn}) ffun = fittype(expr, Name, Value,。..) ffun= fittype({expr1,。..,exprn}, Name, Value,。..) /***********************************线性拟合***********************************/ 线性拟合公式: coeff1 * term1 + coeff2 * term2 + coeff3 * term3 + 。.. 其中,coefficient是系数,term都是x的一次项。 线性拟合Example: Example1: y=kx+b; 法1: [csharp] view plain copy 1. x=[1,1.5,2,2.5,3];y=[0.9,1.7,2.2,2.6,3]; 2. p=polyfit(x,y,1); 3. x1=linspace(min(x),max(x)); 4. plot(x,y,‘*’,x1,y1); 5. 结果:p = y1=polyval(p,x1); 1.0200 0.0400 即y=1.0200 *x+ 0.0400
|
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |