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

📄 least.m

📁 这是一个关于hht变换很有用的工具箱
💻 M
字号:
function [cof1,cof2]=least(x,dt)

% The function LEAST returns the coefficients found by least square method.
% Only 1st column of 2-D input data x(:,1) is processed.
%
% Calling sequence-
% [cof1,cof2]=least(x,dt)
%
% Input-
%	x		- 2-D data x(m,n)
%	dt		- the true delta t
% Output-
%	cof1,cof2	- numbers representing the coefficients 
%
% Used by-
% 	ACC2DIS

%----- Get dimensions
[m,n]=size(x) ;

%----- Calculate the coefficients
sx=sum(x(:,1))	;
sxx=0.	;
for jj=1:m	;
   sxx=sxx+jj*x(jj,1) ;
end
   cof1=(2*(2*m+1)*sx-6*sxx)/(m*(m-1))  ;
   cof2=(12*sxx-6*(m+1)*sx)/(dt*m*(m-1)*(m+1)) ;
   
   
   

⌨️ 快捷键说明

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