• angzhou365
    了解作者
  • matlab
    开发工具
  • 32KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 1
    下载次数
  • 2017-11-10 21:48
    上传日期
实现了huffman编码的原理,简单易看懂,有注释
huffman.zip
  • huffman
  • huffdemo3.m
    2.2KB
  • huffdemo2.m
    3.1KB
  • huffdemo1.m
    3.2KB
  • huffdemo0.m
    1.4KB
  • decode.m
    1KB
  • huff.m
    13.3KB
  • encode.m
    2.2KB
  • demo1.m
    1.4KB
  • demo0.m
    586B
  • huffdemo4.m
    1001B
  • huff.fig
    20.5KB
内容介绍
function varargout = huff(varargin) % HUFF MATLAB code for huff.fig % HUFF, by itself, creates a new HUFF or raises the existing % singleton*. % % H = HUFF returns the handle to a new HUFF or the handle to % the existing singleton*. % % HUFF('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in HUFF.M with the given input arguments. % % HUFF('Property','Value',...) creates a new HUFF or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before huff_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to huff_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help huff % Last Modified by GUIDE v2.5 22-May-2016 12:07:48 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @huff_OpeningFcn, ... 'gui_OutputFcn', @huff_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT % --- Executes just before huff is made visible. function huff_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no out args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to huff (see VARARGIN) % Choose default command line out for huff handles.out = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes huff wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = huff_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning out args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line out from handles structure varargout{1} = handles.out; function input_Callback(hObject, eventdata, handles) % hObject handle to input (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of input as text % str2double(get(hObject,'String')) returns contents of input as a double % --- Executes during object creation, after setting all properties. function input_CreateFcn(hObject, eventdata, handles) % hObject handle to input (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function codeword_Callback(hObject, eventdata, handles) % hObject handle to codeword (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of codeword as text % str2double(get(hObject,'String')) returns contents of codeword as a double % --- Executes during object creation, after setting all properties. function codeword_CreateFcn(hObject, eventdata, handles) % hObject handle to codeword (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on button press in encode. function encode_Callback(hObject, eventdata, handles) % hObject handle to encode (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) L0=get(handles.input,'string'); [len,cf,A,avlen,H,P,codecell]=encode(L0); set(handles.edit3,'string',cf); set(handles.lenav,'string',len); set(handles.H,'string',H); set(handles.eff,'string',P); function edit3_Callback(hObject, eventdata, handles) % hObject handle to edit3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit3 as text % str2double(get(hObject,'String')) returns contents of edit3 as a double % --- Executes during object creation, after setting all properties. function edit3_CreateFcn(hObject, eventdata, handles) % hObject handle to edit3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles) % hObject handle to pushbutton2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) function lenav_Callback(hObject, eventdata, handles) % hObject handle to lenav (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of lenav as text % str2double(get(hObject,'String')) returns contents of lenav as a double % --- Executes during object creation, after setting all properties. function lenav_CreateFcn(hObject, eventdata, handles) % hObject handle to lenav (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function H_Callback(hObject, eventdata, handles) % hObject handle to H (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of H as text % str2double(get(hObject,'String')) returns contents of H as a double % --- Executes during object creation, after setting all properties. function H_CreateFcn(hObject, eventdata, handles) % hObject handle to H (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgro
评论
    相关推荐
    • Huffman_code.zip
      在通信仿真中,经常要使用到Matlab编程,所以为了方便起见,这里用Matlab实现的哈夫曼编码的功能。至于哈夫曼编译码的基本原理,我们可以参考之前的文章《哈夫曼树及编译码》,里面有详细的说明及图解过程。
    • huffman编码.rar
      功能实现 (函数定义内部有对函数功能的简介) 1.编码 2.转码 3.简单菜单 4.字符集及权值可自定义
    • Huffman_code1.zip
      此程序实现了二元和三元的霍夫曼编码,并计算了熵、平均码长和编码效率。
    • Huffmancode.zip
      实现对一篇文章进行每个英文字符的赫夫曼编码功能,方便快捷
    • huffman code.zip
      信息论中,使用matlab实现二元霍夫曼编码
    • Huffman编码
      用C++实现的对26个英文字母的Huffman编码
    • Huffman编码
      用贪心算法求解Huffman编码,建立Huffman树,进行编码译码。
    • Huffman 编码
      实现了Huffman编码算法: 1、使用链表结构。 2、使用《数据结构》(严蔚敏,C语言版)中给出的算法; 3、增加预先排序的功能的算法
    • huffman编码
      huffman编码合集,里面收录了各种数据结构的Huffman编码
    • HuffmanCode.rar
      Huffman编码,编程语言Java,面向对象思想