91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .m
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-06-16
  • 語言: Matlab
  • 標(biāo)簽:

資源簡介

一個(gè)matlab的m函數(shù),封裝了去除粗大誤差并插值的功能。

資源截圖

代碼片段和文件信息

function??[out]=?del_err(xy)

%先判斷是否滿足正態(tài)分布
alpha?=?0.05;
type?=?‘spline‘;
out?=?y;
if?p_judge(yalpha)==?1
???out?=?thegma(xytype);
else
???out?=?thegma(xytype);?%此處用什么?
end
%滿足正態(tài)分布的話進(jìn)行3西格瑪準(zhǔn)則剔除粗大數(shù)據(jù),否則進(jìn)行其他準(zhǔn)則剔除
end

%迭代進(jìn)行3西格瑪準(zhǔn)則剔除,同時(shí)插值
function?[out]?=?thegma(xytype)
n=length(y);%數(shù)組長度
ma?=?mean(y);?%數(shù)組均值
sa?=?std(y);??%數(shù)組標(biāo)準(zhǔn)差
count?=0;
for?i=1:n???%從第一個(gè)開始循環(huán)
?count?=?count+1?;
?H?=?sprintf(‘y(i)=%d?ma=%d?sa=%d\n‘y(i)masa);
?disp(H)
?if?abs(y(i)-ma)>3*sa
?%3西格瑪準(zhǔn)則剔除的粗大數(shù)據(jù)后進(jìn)行插值
????%先剔除數(shù)據(jù)才能插值
xtemp=?x(~ismember(xx(i)));
ytemp=?y(~ismember(yy(i)));
temp?=??interp1(xtempytempx(i)type);
%disp(sprintf(‘i=%dtemp=%d?length(ytemp)=%d\n‘itemplength(ytemp)))
%將插值得到的值再重新插入數(shù)組
y=[y(1:i-1)?temp?y(i:length(ytemp))];
break;
?end?
end

%迭代進(jìn)行3西格瑪準(zhǔn)則剔除,直到都o(jì)k
if(count?~=?n)
out?=?thegma(xytype);
else
out?=y;
end
end

function?out=p_judge(Aalpha)
out?=0;
%?本程序用于判別

評(píng)論

共有 條評(píng)論

相關(guān)資源