Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Matlab xunit without setting Matlab application path

Tags:

matlab

xunit

As far as we can see, to use a library in Matlab it is necessary to add its path to the global Matlab application path e.g. to use the xunit unit testing library, its path must be added to the global path through the user interface. The problems with this are:

  • Each developer must set the dependency paths correctly on their machine, test machines and build machines etc. to be able to run the code correctly
  • We cannot set the paths for each developer centrally so when dependencies change, we must issue instructions for individuals to manually change their configuration
  • If different projects use incompatible dependencies then the path must be reconfigured between changing projects

For C++\C#\Java etc. projects, it is possible to refer to libraries with relative paths from within the project and not require changes to global environment variables.

How can we achieve this with Matlab?

like image 314
daw Avatar asked Mar 10 '26 12:03

daw


1 Answers

You can use the addpath and rmpath commands to manually edit MATLAB's Path. Paths added via these two commands can be relative paths.

like image 149
Azim J Avatar answered Mar 12 '26 07:03

Azim J



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!