CRE_RB_and_CCRE/TestCREClass.m

35 lines
523 B
Matlab

S=CREClass;
S.Data=randn(100,1);
S.nBin=(1000);
%% use histogram
S.UseHistProxy=true;
S.Calc;
S
%% Use my aproximation
S.UseHistProxy=false;
S.Calc;
S
std(S.Data)
%% multiply S
S.Data=100*S.Data;
S.UseHistProxy=true;
S.Calc;
S
std(S.Data)
%% ones again the "new" way
S.UseHistProxy=false;
S.Calc;
S
%% Test CCRE class
figure(1);clf;hold on
A=randn(10);
B=randn(10);
for k=-1:0.1:1
CS=CCREClass;
CS.Data=(1-abs(k))*A+k*B;
CS.nBin=100;
CS.DataRef=B;
CS.nBinRef=50;
CS.Calc;
plot(k,CS.CCRE,'o')
end