diff --git a/TestCREClass.m b/TestCREClass.m index 8fcdf23..12509ae 100644 --- a/TestCREClass.m +++ b/TestCREClass.m @@ -1,25 +1,38 @@ +%% Test CCRE and CRE class +% show some default behaviour +% and test the error handling. +%% set some constants +A=randn(100); +%% create instance of CRE class S=CREClass; -S.Data=randn(100,1); -S.nBin=(1000); -%% use histogram +%% check histogram vs "new" technique +% NB I come to the conclusion that the new method is not always working. +% Why? +S.Data=A;% set gaussian data +S.nBin=(numel(S.Data)); % set nbin to npoints; This is fine as we use the cummulative distribution and the formulas as defined in Zografos +% use histogram S.UseHistProxy=true; S.Calc; S -%% Use my aproximation +% Use my aproximation for the histogram +% only do this if the number of data points is not too big. S.UseHistProxy=false; S.Calc; S -std(S.Data) -%% multiply S -S.Data=100*S.Data; + +%% Show effect of scaling or ofsett the data +% Scale +S.Data=100*A; S.UseHistProxy=true; S.Calc; S -std(S.Data) -%% ones again the "new" way -S.UseHistProxy=false; +% Offset +S.Data=A+10; +S.UseHistProxy=true; S.Calc; S +%% + %% Test CCRE class figure(1);clf;hold on figure(2);clf; @@ -41,6 +54,6 @@ for k=-1:0.1:1 scatter(CS.DataRef(:),CS.Data(:)); figure(3); plot(k,CS.CCRE./CS.CRE,'d'); - pause(0.01) end -CS \ No newline at end of file +CS +snapnow \ No newline at end of file