Matlab cannot identify the mex function

I am trying to run the symmetry dectection algorithm proposed in the paper "Detecting Symmetry and Symmetric Constellations of Features".
One weird thing happend is that I can perfectly run the code without error in my laptop. But when I copy those file into my desktop computer. The mex function cannot be found. It shows the error message:
Undefined function or variable 'histc_weighted_mex'.
Error in histc_weighted (line 67)
hist = histc_weighted_mex(x,weights,edges);
Error in linear_hough (line 30)
Hough_im = reshape(histc_weighted(ind_hs,weights,[1:prod(size(Hough_im))]), size(Hough_im));
Error in symmetry (line 82)
[Hough_im, max_r, max_ang, r, sym_strength] = linear_hough(im,sym_x,sym_y,ang,phase_weight);
I have no idea why this error occur? Can anyone help me?
Both two computer are using MATLAB R2018b

1 commentaire

Walter Roberson
Walter Roberson le 10 Août 2019
Are both of them the same class of operating system? Windows mex cannot be used with Linux for example.

Connectez-vous pour commenter.

Réponses (1)

SaiDileep Kola
SaiDileep Kola le 13 Août 2019

1 vote

You are trying to use mex file generated for mac OS (as I see in the link which you provided) which doesn’t work on platforms other than mac. Since, mex file is platform specific, you can generate mex file again for your platform following the guidelines from the link provided.

4 commentaires

Kwun Yu Wu
Kwun Yu Wu le 13 Août 2019
but both computer are win10 64bit..
Walter Roberson
Walter Roberson le 13 Août 2019
Possibly you generated the .mexw64 on one of the systems, but on the other system it is not on your MATLAB path (that is, you might have copied it, but you possibly did not use pathtool to add it to your path.)
Kwun Yu Wu
Kwun Yu Wu le 14 Août 2019
I just download and run it..
They are all in private folder, which cannot add to the path. But the entry function of mex file (histc_weighted) is also in that folder and I can call it from the outside(linear_hough).
If the entry function can be called from outside, I think the entry function should be able to reference the related mex file under the same directory.
I met the same problem but in my case, I just
mex private\histc_weighted_mex.c
and then the code is runed succeed.
PS. My computer is win10-64 bit with Matlab 2016B.

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB Coder dans Centre d'aide et File Exchange

Question posée :

le 10 Août 2019

Commenté :

le 20 Fév 2020

Community Treasure Hunt

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

Start Hunting!

Translated by