0001 clear
0002
0003 N=10000;
0004
0005
0006 a=nt_normcol(randn(N,5)*randn(5,10));
0007 b=nt_normcol(randn(N,5)*randn(5,10));
0008 c=nt_normcol(randn(N,5)*randn(5,10));
0009
0010
0011 x=[a+1;a;2*a;a;b;c];
0012
0013
0014
0015
0016 figure(1); clf
0017 DEPTH=1;
0018 nt_split(x,1,DEPTH);
0019
0020
0021 figure(2); clf
0022 DEPTH=2;
0023 nt_split(x,2,DEPTH);
0024
0025
0026 figure(3); clf
0027 DEPTH=2;
0028 nt_split(x,3,DEPTH);
0029
0030 TOL=10^-6;
0031 disp(['rank of whole data: ', num2str(rank(x,TOL))]);
0032 idx=nt_split(x,3,DEPTH);
0033 disp(['rank of intervals: ', ...
0034 num2str([rank(x(1:idx(1),:),TOL), ...
0035 rank(x(idx(1)+1:idx(2),:),TOL), ...
0036 rank(x(idx(2)+1:idx(3),:),TOL), ...
0037 rank(x(idx(3)+1:end,:),TOL)])]);