📄 lzparse.m
字号:
% This m-file is called LZparse.m
%It accomplishes Lempel-Ziv parsingof a binary datavector
% x is a binary datavector.
% y=LZparse(x) is a vector consisting of the indices of the
% blocks in the Lempel-Ziv parsing of x.
function y=LZparse(x)
N=length(x);
dict=[];
lengthdict=0;
while lengthdict<N
i=lengthdict+1;
k=0;
while k==0
v=x(lengthdict+1:i);
j=bitstring_to_index(v);
A=(dict~=j);
k=prod(real(A));
if i==N
k=1;
else
end
i=i+1;
end
dict=[dict j];
lengthdict=lengthdict+length(v);
end
y=dict;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -