B
マトリックス(126 x 7)で中央絶対偏差外れ値分析を実行しています。以下のコードは機能していると思いましたが、寸法の不一致に関するエラーが発生します。誰でも私を助けることができますか?私はまだ MATLAB の初心者です。
b = B; %identifying raw data for outlier analysis
k=size(B,2); %preallocating size of loop to run to be equivalent to number columns in B
for j= 1:k
a=b(:,j); %identify data used
fa = abs(a-median(a))./(mad(a,1)./.6745); %if x>3.5 then outlier
dec_mad=fa>2.24; %logical operator identifying outlier
nout(j)=sum(dec_mad); %sum of outliers
x = dec_mad ==0; % logical of data with outliers removed
b(:,j) = a(x); %data without outliers
end