資源簡(jiǎn)介
lzw 編碼的matlab程序,下了就能用,不能用再問(wèn)我。有編碼也有復(fù)原
代碼片段和文件信息
clc;
clear;
close?all;
%初始字典
dic?=?cell(1256);
for?i?=?1:256
????dic{1i}?=?char(i);
end
fid=fopen(‘lzwcode.txt‘‘wt‘);??????%新建一個(gè)txt文件??
phns?=?[‘miao.txt‘];?????????????????%要讀取的文檔所在的路徑??
fpn?=?fopen?(phns?‘rt‘);???????????%打開(kāi)文檔??
file?=?fread(fpn‘*char‘);???????????????????????????
s=length(file);
star=1;
index=257;
P=file(1);
output=zeros;
???for?j?=?2:s;
???C=file(j);???
???len=length(dic);
???????????for
評(píng)論
共有 條評(píng)論