MATLAB Answers

pdistmex - Error - Undefined function 'pdistmex' for input arguments of type 'double'.

10 views (last 30 days)
Julian Brückner
Julian Brückner on 24 Oct 2019
I have got the following problem. The function pdist(X,dist) gives me the following error.
"Undefined function 'pdistmex' for input arguments of type 'double'."
I dont understand why it does not work, because X is always a 'double' or isnt it?
The following lines are the code from the MatLab function pdist(X,dist).
% Call a mex file to compute distances for the standard distance measures
% and full real double or single data.
if ~strcmp(dist,'usr') && (isfloat(X) && ~issparse(X)) % ~usr => ~complex
additionalArg = cast(additionalArg,class(X));
% Here is the error.
Y = pdistmex(X',dist,additionalArg)
elseif ~strcmp(dist,'usr') && isfloat(X) % ~usr => ~complex
additionalArg = cast(additionalArg,class(X));
Y = pdistSparse(X', dist, additionalArg);

Answers (1)

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi on 31 Oct 2019
Edited: Sahithi Kanumarlapudi on 31 Oct 2019
You usually get this error if don’t have license to the required toolbox. Ensure that you have license to ‘Statistics and Machine Learning Toolbox’.
If you have a valid license and still you are getting the error then run the following commands
rehash toolboxcache
The following link shows the common errors and reasons while running functions
Hope this helps!


Sign in to comment.

Community Treasure Hunt

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

Start Hunting!