Worked on statistics chapter

This commit is contained in:
2015-11-02 19:06:43 +01:00
parent f44ae51c68
commit cb7924ffd5
6 changed files with 134 additions and 59 deletions

View File

@@ -1,10 +1,10 @@
% check whether the median returned by mymedian
% really separates a vector into two halfs
for i = 1:140 % loop over different length
for k = 1:10 % try several times
a = randn( i, 1 ); % generate some data
m = mymedian( a ); % compute median
if length( a(a>m) ) ~= length( a(a<m) ) % check
for i = 1:140 % loop over different length
for k = 1:10 % try several times
a = randn( i, 1 ); % generate some data
m = mymedian( a ); % compute median
if length( a(a>m) ) ~= length( a(a<m) ) % check
disp( 'error!' )
end
end