mmtools - Miscellaneous Matlab Tools
A collection of free and open source Matlab tools.
(c) Andreas Sommer, 2010-2024
E-Mail: code@andreas-sommer.eu
Tools marked with ⭐ might be especially worth a look.
- ADLER32 - Compute Adler32 hash [->code]
- execWSL - Execute command in WSL (Windows Subsystem for Linux) [->code]
- hornereval - Evaluate 1d polynomial using Horner's scheme [->code]
- hornereval2D - Evaluate 2d polynomial using Horner's scheme [->code]
- integrate_with_restarts⭐ - Integrade implicitly switched ODE with state jumps [->code]
- isfigure - Check if variable is handle to a figure [->code]
- istext - Check if variable is a char array or a string [->code]
- makeClosure - Mimick pass-by-reference via closure [->code]
- msession⭐ - Store and retrieve Matlab sessions (open files, work space variables, etc.) [->code]
- optionlists⭐ - Handle name-value pairs [->code]
- roundto - Rounds values to nearest divisor value [->code]
- sviz - Simple visualizer [->code]
- whichToolboxFor - Investigate toolbox dependency of code [->code]
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.
execWSL [see code]
Executes a command in WSL (Windows Subsystem for Linux).
Distribution can be chosen. Dryrun and echoing supported.
hornereval [see code]
Evaluation of 1d polynomials using Horner's scheme.
hornereval2D [see code]
Evaluation of 2d polynomials using Horner's scheme.
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.
isfigure [see code]
Queries if specified handle refers to a (valid) figure.
istext [see code]
Checks if specified object is a char array or a string
makeClosure [see code]
Generates a closure to mimick pass-by-reference style of programming.
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
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
For details, see, help olGetOption
.
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
roundto [see code]
Rounds values to the nearest divisor value. See roundto_example.m for an example.
sviz [see code]
Simple viszalization tool.
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.
Cite As
Andreas Sommer (2024). mmtools - Miscellaneous Matlab Tools (https://github.com/andreassommer/mmtools), GitHub. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
speedtests/integration_parametric
Versions that use the GitHub default branch cannot be downloaded
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |
|