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

📄 polyfitxy.m

📁 fit programme for a serials of data
💻 M
字号:
function A=polyfitxy(x,y,m)
%input x is a 1*N vector 
%      y is a 1*N vector
%      m is the degree of the polynomial to be obtain
%output A is the coeficient of the polynomial
n=length(x);
f=zeros(n,m+1);
%fill the columns of f with the powers of x
for i=1:m+1
    f(:,i)=x.^(i-1);
end
%solve the linear system to obtain the coeficient of polynomial 
B=f'*f;
C=f'*y';
A=B\C;
end

⌨️ 快捷键说明

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