lloyd function is in the path, but is not recognised when executed

3 views (last 30 days)
Hi, i have the following problem. I am trying to use the function lloyds from the Communication Systems Toolbox on my Linux PC (Matlab R2017b) with the following test script:
testsignal = randn(100,1);
[rec_levels,dec_thresholds] = lloyds(testsignal,2^4,10^(-10));
and get the following error: Undefined function 'lloyds' for input arguments of type 'double'.
The weird part starts now. If I right click and open the function it opens normally and I can see it's path. If I copy the contents of the function into a local copy and try to execute again, I get the same error for some other function of the Communications System Toolbox ( function quantiz). So apparently there is some problem with the Communication System Toolbox, even though it is in the path. Any idea on how to overcome that problem?
Thanks in advance

Answers (1)

Benjamin Kraus
Benjamin Kraus on 13 Dec 2017
I think I would start with:
restoredefaultpath
rehash toolboxcache
That will (temporarily) reset your path to the default path. If that fixes the problem, then there is something wrong with the pathdef.m file, either in your home directory or in the MATLAB toolbox directory. Try:
which -all pathdef.m
If there are more than one entries, check the ones that are not in the MATLAB toolbox directory are not corrupted somehow. I've seen things like this happen when you have two copies of pathdef.m and install a new copy of MATLAB. The new copy of MATLAB installs a new copy of pathdef.m in the MATLAB toolbox directory, but that copy is shadowed by another copy in your home directory that is outdated and based on an old copy of MATLAB.
If all else fails, try calling MathWorks Technical Support.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!