SlideShare a Scribd company logo
1 of 2
Download to read offline
Instituto Politécnico Nacional
Introducción a los Sistemas de Comunicación Seguros
Unidad MISTI Culhuacan
Presentado a: Dr. Gualberto Aguilar Torres
Algoritmo de comprensión
LZW
11
Por: Yango Alexander Colmenares
Fecha
Octubre de 2013
%% INSTITUTO POLITECNICO NACIONAL-MISTI CULHUACAN --- MEXICO DF 2013
%%Desarrollado por:Yango Colmenares
%Presentado a : Dr. Gualberto Aguilar Torres
%Programación en Matlab
%Codigo Lzw
clc;
clear all;
%%%SE ESTABLECEN CARACTERES VALIDOS Y COLUMNAS DE ASIGNACIÓN
llaves =
{'a','b','c','d','e','f','g','h','i','j','k','l','m','n','ñ','o','p','q',
'r','s','t','u','v','w','x','y','z'};
valores =
{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27}
;
dicc = containers.Map(llaves, valores);
diccR = containers.Map(valores, llaves);
%%%MENSAJE A CODIFICAR CON PALABRAS REPETITIVAS CARACTERES ACEPTADOS POR
EL
%%%PROGRAMA
M = 'MIRAMESINMIRARMIRIAM';
M = lower(M);
M(ismember(M,' ,.:;!')) = [];
subcad = '';
outV = [];
for i=1:length(M)
subcad = strcat(subcad, M(i));
if ~isKey(dicc, subcad)
dicc(subcad) = length(dicc) + 1;
outV = [outV dicc(subcad(1:end - 1))];
subcad = subcad(end:end);
end
if i == length(M)
outV = [outV dicc(subcad)];
end
end
%%%MENSAJE A CODIFICAR CON SALIDA
disp('Resultado de la Codificación:');
disp(outV);
%%%MENSAJE A CODIFICAR CON SALIDA
dicc = containers.Map(llaves, valores);
subcad = '';
subV = [];
outC = '';
for i=1:length(outV)
subcad = strcat(subcad, diccR(outV(i)));
subV = [subV outV(i)];
subcadCell = repmat(subcad,length(subcad),1);
subcadCell = cellstr(char(subcadCell .*
tril(ones(length(subcadCell)))));
j = find(~dicc.isKey(subcadCell),1,'first');
if j > 0
dicc(subcadCell{j}) = length(dicc) + 1;
diccR(length(dicc)) = subcadCell{j};
subcad = diccR(subV(end:end));
outC = strcat(outC, diccR(subV(1:1)));
subV = subV(2:end);
end
if i == length(outV)
outC = strcat(outC, subcad);
end
end
disp('Decodificación:');
disp(outC);

More Related Content

More from Yango Alexander Colmenares

Codigo entropía criptográfica (yango colmenares)
Codigo entropía criptográfica  (yango colmenares)Codigo entropía criptográfica  (yango colmenares)
Codigo entropía criptográfica (yango colmenares)Yango Alexander Colmenares
 
Actividad #7 codigo detección de errores (yango colmenares)
Actividad #7 codigo detección de errores (yango colmenares)Actividad #7 codigo detección de errores (yango colmenares)
Actividad #7 codigo detección de errores (yango colmenares)Yango Alexander Colmenares
 
código detección de errores (yango colmenares)
código detección de errores (yango colmenares)código detección de errores (yango colmenares)
código detección de errores (yango colmenares)Yango Alexander Colmenares
 
Codigo rsa manejo de llaves publicas y privadas (yango colmenares)
Codigo rsa manejo de llaves publicas y privadas (yango colmenares)Codigo rsa manejo de llaves publicas y privadas (yango colmenares)
Codigo rsa manejo de llaves publicas y privadas (yango colmenares)Yango Alexander Colmenares
 
Codigo detección y corrección de errores (yango colmenares)
Codigo detección y corrección de errores (yango colmenares)Codigo detección y corrección de errores (yango colmenares)
Codigo detección y corrección de errores (yango colmenares)Yango Alexander Colmenares
 

More from Yango Alexander Colmenares (17)

Ingeniero Véndete en el Mercado Global
Ingeniero Véndete en el Mercado GlobalIngeniero Véndete en el Mercado Global
Ingeniero Véndete en el Mercado Global
 
Algoritmo comprensión dct(yango colmenares)
Algoritmo comprensión dct(yango colmenares)Algoritmo comprensión dct(yango colmenares)
Algoritmo comprensión dct(yango colmenares)
 
Algoritmo comprensión lsb(yango colmenares)
Algoritmo comprensión lsb(yango colmenares)Algoritmo comprensión lsb(yango colmenares)
Algoritmo comprensión lsb(yango colmenares)
 
codigo comprensión(yango colmenares)
codigo comprensión(yango colmenares)codigo comprensión(yango colmenares)
codigo comprensión(yango colmenares)
 
Codigo huffman (yango colmenares)
Codigo huffman (yango colmenares)Codigo huffman (yango colmenares)
Codigo huffman (yango colmenares)
 
Codigo entropía criptográfica (yango colmenares)
Codigo entropía criptográfica  (yango colmenares)Codigo entropía criptográfica  (yango colmenares)
Codigo entropía criptográfica (yango colmenares)
 
Actividad #7 codigo detección de errores (yango colmenares)
Actividad #7 codigo detección de errores (yango colmenares)Actividad #7 codigo detección de errores (yango colmenares)
Actividad #7 codigo detección de errores (yango colmenares)
 
código detección de errores (yango colmenares)
código detección de errores (yango colmenares)código detección de errores (yango colmenares)
código detección de errores (yango colmenares)
 
Codigo rsa manejo de llaves publicas y privadas (yango colmenares)
Codigo rsa manejo de llaves publicas y privadas (yango colmenares)Codigo rsa manejo de llaves publicas y privadas (yango colmenares)
Codigo rsa manejo de llaves publicas y privadas (yango colmenares)
 
Codigo detección y corrección de errores (yango colmenares)
Codigo detección y corrección de errores (yango colmenares)Codigo detección y corrección de errores (yango colmenares)
Codigo detección y corrección de errores (yango colmenares)
 
Codigo hill claves (yango colmenares)
Codigo hill claves (yango colmenares)Codigo hill claves (yango colmenares)
Codigo hill claves (yango colmenares)
 
Criterios de Excelencia en Redes de Internet
Criterios de Excelencia en Redes de InternetCriterios de Excelencia en Redes de Internet
Criterios de Excelencia en Redes de Internet
 
Iso 27001 2013
Iso 27001 2013Iso 27001 2013
Iso 27001 2013
 
Itil v3 & 27001
Itil v3 & 27001Itil v3 & 27001
Itil v3 & 27001
 
Valores corporativos
Valores corporativosValores corporativos
Valores corporativos
 
Andragogia
AndragogiaAndragogia
Andragogia
 
Equidad y genero
Equidad y generoEquidad y genero
Equidad y genero
 

Recently uploaded

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 

Recently uploaded (20)

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 

LZW Algorithm Code for Text Compression in Matlab

  • 1. Instituto Politécnico Nacional Introducción a los Sistemas de Comunicación Seguros Unidad MISTI Culhuacan Presentado a: Dr. Gualberto Aguilar Torres Algoritmo de comprensión LZW 11 Por: Yango Alexander Colmenares Fecha Octubre de 2013 %% INSTITUTO POLITECNICO NACIONAL-MISTI CULHUACAN --- MEXICO DF 2013 %%Desarrollado por:Yango Colmenares %Presentado a : Dr. Gualberto Aguilar Torres %Programación en Matlab %Codigo Lzw clc; clear all; %%%SE ESTABLECEN CARACTERES VALIDOS Y COLUMNAS DE ASIGNACIÓN llaves = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','ñ','o','p','q', 'r','s','t','u','v','w','x','y','z'}; valores = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27} ; dicc = containers.Map(llaves, valores); diccR = containers.Map(valores, llaves); %%%MENSAJE A CODIFICAR CON PALABRAS REPETITIVAS CARACTERES ACEPTADOS POR EL %%%PROGRAMA M = 'MIRAMESINMIRARMIRIAM'; M = lower(M); M(ismember(M,' ,.:;!')) = []; subcad = ''; outV = []; for i=1:length(M) subcad = strcat(subcad, M(i)); if ~isKey(dicc, subcad) dicc(subcad) = length(dicc) + 1; outV = [outV dicc(subcad(1:end - 1))]; subcad = subcad(end:end); end if i == length(M)
  • 2. outV = [outV dicc(subcad)]; end end %%%MENSAJE A CODIFICAR CON SALIDA disp('Resultado de la Codificación:'); disp(outV); %%%MENSAJE A CODIFICAR CON SALIDA dicc = containers.Map(llaves, valores); subcad = ''; subV = []; outC = ''; for i=1:length(outV) subcad = strcat(subcad, diccR(outV(i))); subV = [subV outV(i)]; subcadCell = repmat(subcad,length(subcad),1); subcadCell = cellstr(char(subcadCell .* tril(ones(length(subcadCell))))); j = find(~dicc.isKey(subcadCell),1,'first'); if j > 0 dicc(subcadCell{j}) = length(dicc) + 1; diccR(length(dicc)) = subcadCell{j}; subcad = diccR(subV(end:end)); outC = strcat(outC, diccR(subV(1:1))); subV = subV(2:end); end if i == length(outV) outC = strcat(outC, subcad); end end disp('Decodificación:'); disp(outC);