Invalid MEX-file error when using betweenness_centrality.m script - not sure why!
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
Steven Lord
2023-5-31
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
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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1399364/image.png)
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call Python from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!