mmtools - Miscellaneous Matlab Tools

Miscellaneous Matlab Tools - managing Matlab sessions (switch between projects) - integration of implicitly switched ODE - many many more
3 Downloads
Updated 18 Jul 2024

mmtools - Miscellaneous Matlab Tools

A collection of free and open source Matlab tools.

(c) Andreas Sommer, 2010-2024
E-Mail: code@andreas-sommer.eu

List of Tools

Tools marked with ⭐ might be especially worth a look.

Documentation is provided inside the code and thus available using Matlab's help system via help and doc.



ADLER32 [see code]

Computes the Adler32 hash of a given char array.

Return to list of tools

execWSL [see code]

Executes a command in WSL (Windows Subsystem for Linux).
Distribution can be chosen. Dryrun and echoing supported.

Return to list of tools

hornereval [see code]

Evaluation of 1d polynomials using Horner's scheme.

Return to list of tools

hornereval2D [see code]

Evaluation of 2d polynomials using Horner's scheme.

Return to list of tools

integrate_with_restarts⭐ [see code]

A Matlab tool for integration of switched ODEs, with implicit (state-dependent) model and state changes.
Only integration is supported.
The tool IFDIFF is much more sophisticated. It generates switching functions automatically from existing code with IF statements and can also compute forward sensitivities.

Return to list of tools

isfigure [see code]

Queries if specified handle refers to a (valid) figure.

Return to list of tools

istext [see code]

Checks if specified object is a char array or a string

Return to list of tools

makeClosure [see code]

Generates a closure to mimick pass-by-reference style of programming.

Return to list of tools

msession⭐ [see code]

Stores a whole Matlab work session in a file, and restores it upon request. The user can select what to be stored:

  • open files
  • main work space variables
  • global variables

Return to list of tools

optionlists⭐ [see code]

Matlab tools for handling name-value pairs, especially in function calls.

  • querying arguments by name: olGetOption
  • checking for present arguments: olHasOption
  • generation of option lists: olSetOption
  • removing from option lists: olRemoveOption
  • checking validity: olIsOptionlist, olAssertOptionlist

Documentation

For details, see, help olGetOption.

Example

Call:

  val = f(a,b,'name','test','age',35,'numbers',{1,7,2})

Function code:

function val = f(a,b,varargin)
    % a and b are normal position-dependent arguments.
    % Further arguments are (usually) optional and initialized by default values.
  
    % Set default values
    name    = 'defaultname';
    age     = 0;
    numbers = {1,2,3,4,5};
    
    % Query optional arguments:
    if olHasOption(varargin, 'name'   ),    name = olGetOption(varargin, 'name'   );  end
    if olHasOption(varargin, 'age'    ),     age = olGetOption(varargin, 'age'    );  end
    if olHasOption(varargin, 'numbers'), numbers = olGetOption(varargin, 'numbers');  end
    
    % program code 
    % ...
end    

Return to list of tools

roundto [see code]

Rounds values to the nearest divisor value. See roundto_example.m for an example.

Return to list of tools

sviz [see code]

Simple viszalization tool.

Return to list of tools

whichToolboxFor [see code]

Retrieves the required Matlab Toolboxes for specified mfile. Also inspects all files invoked by mfile and checks their dependency. Additionaly prints for every used toolbox the list of files that actually require them.

Return to list of tools

Cite As

Andreas Sommer (2024). mmtools - Miscellaneous Matlab Tools (https://github.com/andreassommer/mmtools), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2024a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.