matlab-bgl icon indicating copy to clipboard operation
matlab-bgl copied to clipboard

c file not recognized : 'matlab_bgl_sp_mex'

Open megalulu opened this issue 3 years ago • 10 comments

Hello,

Thank you for creating this algorithm! I downloaded it because it seems to be a dependency for the code of directional connectivity index (DCI). I want to calculate the DCI for a riparian ecosystem in two directions (along the river axis and perpendicular to the river axis).

I'm new to Matlab, but I get this error when running the code:

Error in shortest_paths (line 131) [d pred] = matlab_bgl_sp_mex(A,u,target,lower(options.algname),options.inf,...

Error in DCIu (line 29) d = shortest_paths(distance, start_nodes(ii)); %A vector of the shortest path between starting/source node and all other nodes

Error in connectivity_at_angle (line 117) fval = DCIu(distance, dx, pixelx)

the 'matlab_bgl_sp_mex.c' function seems to be written in c, and Matlab doesn't recognize it. There should be a matlab_bgl_sp_mex.h file associated to it?

Thank you for any help! Meghana

megalulu avatar Jul 29 '21 18:07 megalulu

Hi there -- you might have to rename some of the mex files if you are on windows. What system do you have?

dgleich avatar Aug 04 '21 16:08 dgleich

Undefined function or variable 'matlab_bgl_sp_mex'.

Error in shortest_paths (line 131) [d pred] = matlab_bgl_sp_mex(A,u,target,lower(options.algname),options.inf,...

Error in dijkstra_sp (line 53) [d pred] = shortest_paths(A,u,options);

Error in OCY_assign_dist (line 70) [d,~]=dijkstra_sp(A,cels(i).node);

Error in OCY_main (line 71) [node,link,cell] = OCY_assign_dist(node,link,cells,A); %this is the step that takes longest, preallocate the struct for speed

Error in OCY_analyze_all (line 19) OCY_main(path{i},'*.tif'); Hello, I have come across a similar situation as well when using this and I am new to MatLab as well. I am currently on Windows hoping to see if there was a resolution to this. Do I have to rename the .c files which end with _mex to something else?

Abhay2412 avatar Oct 03 '22 12:10 Abhay2412

No, you may need to rename the .dll files to .mexw32 ...

dgleich avatar Oct 03 '22 13:10 dgleich

Sorry, but where would I find these .dll files

Abhay2412 avatar Oct 03 '22 14:10 Abhay2412

They should be in the private directory

On Mon, Oct 3, 2022 at 10:00 AM Abhay Khosla @.***> wrote:

Sorry, but where would I find these .dll files

— Reply to this email directly, view it on GitHub https://github.com/dgleich/matlab-bgl/issues/25#issuecomment-1265488430, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIJS24ZR2J6SW3TQ4HBMDWBLRJFANCNFSM5BHADIIA . You are receiving this because you commented.Message ID: @.***>

dgleich avatar Oct 03 '22 14:10 dgleich

privateDirectory This is all I see in the private directory

Abhay2412 avatar Oct 03 '22 14:10 Abhay2412

Please download the library from mathworks https://www.mathworks.com/matlabcentral/fileexchange/10922-matlabbgl

dgleich avatar Oct 03 '22 14:10 dgleich

Should I remove the old matlab-bgl-master from the MATLAB path as the link you shared once I added the private folder has more files and even with .mexw32 and .mexw64. And thank you so much for your help means alot 👍

Abhay2412 avatar Oct 03 '22 14:10 Abhay2412

Correct, you don't need the old one.

dgleich avatar Oct 03 '22 15:10 dgleich

Just wanted to say a huge thanks for resolving the issue I was having. I appreciate your swift responses.

Abhay2412 avatar Oct 04 '22 10:10 Abhay2412