I'm trying to make a .m
file that uses a .dll
file and I want to be able to pass my script to other people without error. The only problem is that matlab always searches starting at the matlabroot or some drive if you specify. The location of the folder containing this project is going to vary depending on the user. So I can't simply use the function:
loadlibrary("C:\Users\Public\Documents\projectFolder\file.dll", "C:\Users\Public\Documents\projectFolder\file.h")
in my .m
file assuming that every user has the project folder in "C:\Users\Public\Documents"
.
I'm trying to see if there's a way for matlab to just know where the .m
file is and start at that path, then maybe I could set the code up like this:
path = [some code which finds the path of .m file];
loadlibrary(strcat(path, 'file.dll'), strcat(path, 'file.h'));
Thanks