File Exchange

image thumbnail


version 1.0.20 (14.8 KB) by DataJoint Bot
'ghtb' provides a simple way to manage addon installation of open-source MATLAB Community Toolboxes linked to GitHub (via Releases).

1 Download

Updated 05 Nov 2020

From GitHub

View Version History

View license on GitHub

INSTALL(target, varargin)
Provides a way to directly 'install' MATLAB Community Toolboxes from
Github. For upgrade and downgrade use-cases, users can set the `override` option to
force the install.
target[required]: (string) Toolbox repo (e.g. 'org1/repo1') or local path to *.mltbx
version[optional, default='latest']: (string||handle) Version to be installed e.g.
'1.0.0' or version handle of the form @(v) that
resolves to acceptable versions. Handle approach
should expect v to be a cell array of version
candidates and return a logical array of result.
override[optional, default=false]: (boolean) Flag to indicate if should override an
existing install
- Community Toolbox linked on FileExchange to GitHub via GitHub Releases.
- Community Toolbox publicly available as open-source on GitHub.
- Community Toolbox attaches a single '.mltbx' artifact to GitHub Releases.
- Community Toolbox name matches the filename of '.mltbx' artifact.
- Users do not wish to have multiple simultaneous versions installed i.e. only a
single version per Toolbox is installed at any given time.
ghtb.install('guzman-raphael/compareVersions', 'version', '1.0.7')
ghtb.install('guzman-raphael/compareVersions', 'version', '1.0.6', 'override', true)
ghtb.install('guzman-raphael/compareVersions', 'version', ...
@(v) cellfun(@(x) contains(x, '1.0.'), v, 'uni', true))
ghtb.install('compareVersions.mltbx') %install from local toolbox file

Provides a way to directly 'uninstall' MATLAB Community Toolboxes from
toolboxName[required]: (string) Toolbox name to be uninstalled e.g. 'toolbox1'
- Users do not wish to have multiple simultaneous versions installed i.e. all
versions of specified toolbox are uninstalled (if applicable).
ghtb.uninstall('compareVersions') % uninstalls all versions of Toolbox

REQUIRE(requiredToolboxes, varargin)
Provides a way to directly require specific toolboxes with the option to 'install' if
not satisfied. Unsatisfied toolboxes with trigger a
'GHToolbox:requireToolboxes:Failed' error.
requiredToolboxes[required]: (cell) Toolboxes to be required and (if applicable)
resolved with installation. Each cell should contain a
struct with fields: Name[required, string],
ResolveTarget[required, string],
Version[optional, string||handle]. For Version
specification, see below for examples or
see help(ghtb.install) for accepted Version assignment.
prompt[optional, default=true]: (boolean) Whether to silently install or use prompts.
resolveGHToolboxDeps[optional, default=true]: (boolean) Resolve dependencies related
to GHToolbox.
requiredToolboxes = {...
'Name', 'GHToolbox', ...
'ResolveTarget', 'datajoint/GHToolbox'...
), ...
'Name', 'compareVersions', ...
'ResolveTarget', 'guzman-raphael/compareVersions', ...
'Version', '1.0.8'...
), ...
'Name', 'mym', ...
'ResolveTarget', 'datajoint/mym', ...
'Version', @(v) cellfun(@(x) contains(x, '2.7.'), v, 'uni', true)...
ghtb.require(requiredToolboxes) % require with prompts
ghtb.require(requiredToolboxes, 'prompt', false)

PACKAGE(toolboxName, toolboxAuthor, toolboxContact, toolboxSummary, ...
toolboxDescription, toolboxExclusions, toolboxVersionHandle, ...
toolboxRootFiles, varargin)
Provides a programatic way to 'package' MATLAB Community Toolboxes.
toolboxName[required]: (string) Toolbox name, will create as '{{toolboxName}}.mltbx'.
toolboxAuthor[required]: (string) Toolbox author full name.
toolboxContact[required]: (string) Toolbox author email.
toolboxSummary[required]: (string) Toolbox summary. Limit to 140 characters.
toolboxDescription[required]: (string) Toolbox long description.
toolboxExclusions[required]: (cell) Filepaths to exclude. Based from
toolboxVersionHandle[required]: (handle) Function that

Cite As

DataJoint Bot (2021). GHToolbox (, GitHub. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2016b
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!