when using different pc's my matlab has issues connecting to one drive, partly driven by the fact that the path name is different due to teh pc I am using.
Best Answer
It's hard to determine from your question what exactly you are trying to do. But this may help:
you can get the name of your PC. I have my startup.m in a onedrive folder. And by using this line I can set paths accordingly in my startup script and perform various different startup tasks depending on which PC I am using.
"The current folder has to remain the same, because I use data from this folder."
That is a really bad reason to run code in a particular folder. Once you start using relative and absolute paths then you have no restriction on where the data needs to be. All MATLAB functions that accept filenames also accept absolute filenames, so there is no excuse not to use them.
Best Answer