Clear Filters
Clear Filters

Invalid MEX-file error when using betweenness_centrality.m script - not sure why!

2 views (last 30 days)
Hey all,
I am trying to run the 'betweenness_centrality.m' script from the MatlabBGL package.
I am using a 64-bit macbook air and am using the matlab version 'Matlab2023a'.
However, when I try to run it, I get the following error:
Invalid MEX-file '/Users/macbook/Desktop/UCL PhD
Work/py_scripts/betweenness_centrality_mex.mexmaci64':
dlopen(/Users/macbook/Desktop/UCL PhD
Work/py_scripts/betweenness_centrality_mex.mexmaci64, 0x0006): Library not loaded:
'@loader_path/libmex.dylib'
Referenced from: '/Users/macbook/Desktop/UCL PhD
Work/py_scripts/betweenness_centrality_mex.mexmaci64'
Reason: tried: '/Users/macbook/Desktop/UCL PhD Work/py_scripts/libmex.dylib' (no
such file), '/usr/local/lib/libmex.dylib' (no such file),
'/usr/lib/libmex.dylib' (no such file)
Error in betweenness_centrality (line 110)
bc = betweenness_centrality_mex(A,weight_arg);
Error in Spacesocialproject (line 3)
bc = betweenness_centrality(G);
I have ensured that the 'betweenness_centrality_mex.mexmaci64' file is in the same directory as the matlab scripts.
I would be so grateful for a helping hand as to why this may be!
  6 Comments
Steven Lord
Steven Lord on 31 May 2023
Looks like they differ by a scaling factor.
format longg
P = [0.28888888888888886, 0.28888888888888886, 0.28888888888888886, 0.25742574257425743];
M = [0.0111, 0.0111, 0.0111, 0.0099];
scaleFactor = P./M
scaleFactor = 1×4
26.026026026026 26.026026026026 26.026026026026 26.002600260026
I'm betting if you actually used all the decimal places stored in the values in MATLAB each element of the scaling factor vector would be even closer to the same number.
I don't know what scaling factor or method Python uses. If you forced me to guess perhaps their definition doesn't divide by like the definition on the centrality documentation page does?
Emre
Emre on 31 May 2023
Thank you so much! Yes, I thought there was some sort of scaling factor that related them :)

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!