📄 complexity.m
字号:
function cmp=complexity(x,n);% cmp = complexity(x,n);%% calculate the Lempel-Ziv complexity of the n-bit encoding of x. %% cmp is the normalised complexity, that is the number of distinct% symbol sequences in x, divided by the expected number of distinct % symbols for a noise sequence.%% Algorithm is implemented in complexitybs.c%% M. Small% ensmall@polyu.edu.hk% 7/10/04if nargin<2, n=2;end;if length(n)>1, for ni=1:length(n), cmp(ni)=complexity(x,n(ni)); end; else, %do the binning, with equi-probably bins x=x(:); nx=length(x); [xn,xi]=sort(x); y=zeros(nx,1); y=1:nx; y=floor(y.*(n/(nx+1))); x(xi)=y; %compute complexity with complexitybs cmp=complexitybs(x+eps);end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -