Skip to content

TU-Delft-DCC/matlab_dependency_manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dependency Manager for MATLAB

This MATLAB class provides utility functions to manage and check dependencies required for executing MATLAB scripts. It allows users to:

  • Check if required MATLAB toolboxes are installed.
  • Identify dependencies of MATLAB files.
  • Read and write dependency lists to a file.

Installation

Simply download and add the class to your MATLAB path:

addpath('path/to/DependencyManager');

Usage

1. Check if a Dependency is Installed

To check if a MATLAB toolbox is installed:

isInstalled = DependencyManager.isDependencyInstalled("Simulink");

For multiple dependencies:

isInstalled = DependencyManager.isDependencyInstalled(["Aerospace Toolbox", "Curve Fitting Toolbox"]);

2. Find Dependencies of MATLAB Files

To analyze the dependencies required for executing a file or a set of files:

dependencies = DependencyManager.findDependencies("myScript.m");

For multiple files:

dependencies = DependencyManager.findDependencies(["script1.m", "script2.m"]);

Using wildcards to scan folders:

dependencies = DependencyManager.findDependencies("myFolder/*.m");

3. Read Dependencies from a File

If you have a file listing dependencies (created with writeDependencies), you can read it:

dependencies = DependencyManager.readDependencies("dependencies.txt");

4. Write Dependencies to a File

To save the list of required dependencies for future reference:

DependencyManager.writeDependencies(dependencies, "dependencies.txt");

Example Workflow

% Find dependencies of a script
requiredToolboxes = DependencyManager.findDependencies("example.m");

% Check if all required toolboxes are installed
isInstalled = DependencyManager.isDependencyInstalled(requiredToolboxes);

% Save dependencies to a file
DependencyManager.writeDependencies(requiredToolboxes, "dependencies.txt");

License

This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.

Acknowledgments

Modified from MatlabUtils by Carmine Varriale.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages