Can somebody please Explain why I got this Error by running this code using MATLAB

Hello People, I'm trying to run this using MAtlab and got this error "Undefined function 'huffmandict' for input arguments of type 'double'". Can sb tell or explain me why this error and what can I do to solve this problem???
symbols = [1:5]; p = [.3 .3 .2 .1 .1]; [dict,avglen] = huffmandict(symbols,p) samplecode = dict{5,2} % Codeword for fifth signal value
"Undefined function 'huffmandict' for input arguments of type 'double'"

 Respuesta aceptada

Do you have the Communication Toolbx on your system? Try
>> which huffmandict
>> ver comm
I get these responses
>> which huffmandict
C:\Program Files\MATLAB\R2012a\toolbox\comm\comm\huffmandict.m
>> ver comm
-------------------------------------------------------------------------------------
MATLAB Version: 7.14.0.739 (R2012a)
MATLAB License Number: xxxxxx
Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1)
Java Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
--------------------------------------------------------------------------------------
Communications System Toolbox Version 5.2 (R2012a)

3 comentarios

Walter Roberta
Walter Roberta el 14 de Dic. de 2012
Editada: Walter Roberta el 14 de Dic. de 2012
I think I don't have it because I've got this answer below
which huffmandict ver comm 'huffmandict' not found. ------------------------------------------------------------------------------------------------ MATLAB Version: 7.14.0.739 (R2012a) MATLAB License Number: STUDENT Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1) Java Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot™ Client VM mixed mode ------------------------------------------------------------------------------------------------ Warning: No properly formatted Contents.m file was found for 'comm'. > In ver at 47
Now what should I do to get it?????????????????
Depends on what kind of license you have
  • With students edition buy it as an add-on
thanks Isakson, I got it

Iniciar sesión para comentar.

Más respuestas (1)

Do you have the toolbox installed that has this function? If you type "ver" at the command prompt, you should see "Communications System Toolbox"
You and also use "which" to see where the function is coming from to make sure there's not another one on your path that might be getting in the way.

1 comentario

Note: Communications Systems Toolbox is not one of the products included as part of the Student Version; it is, though, available at extra cost.

Iniciar sesión para comentar.

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by