Skip to content
/ deck Public

A general-purpose Matlab (2015+) toolbox that doesn't get in your way.

License

Notifications You must be signed in to change notification settings

jhadida/deck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

687dc47 · Feb 21, 2020
Feb 1, 2020
Feb 21, 2020
Jul 5, 2019
Aug 29, 2019
Oct 2, 2019
Jul 10, 2019
Jan 29, 2020
Dec 21, 2018
Jan 21, 2019
Apr 2, 2019
Jun 22, 2017
Sep 22, 2019
Aug 29, 2019
Aug 29, 2019
Sep 20, 2019
Jan 29, 2020
Aug 29, 2019
Jun 26, 2019

Repository files navigation

License: AGPL v3 Documentation

NOTE (June 2019): This toolbox has undergone a considerable refactoring; a new documentation is being written, but in case of inconsistencies, please rely on the functions' helptext.

Deck

A general-purpose Matlab (2015+) toolbox that doesn't get in your way. Deck is now an aggregate of 3 sub-projects:

  • The original dk toolbox, containing general tools to extend Matlab's capabilities;
  • The new ant toolbox, containing analysis tools mainly for time-series data;
  • The new jmx library, with a lightweight C++ library making it super-easy to write Mex files.

Requirements

  • Matlab 2015+;
  • A recent version of git (tested with 2.0+);
  • Linux or OSX system (some users reported ok on Windows, but untested);
  • Up-to-date C++ compiler (tested with g++ and clang++);
  • Mex setup (see how to).

Installation

Choose a folder where you would like to put this toolbox; a good default choice is Matlab's userpath() (usually ~/Documents/MATLAB). Whatever you choose, we refer to this location as FOLDER in Matlab, and $FOLDER in a shell.

From a terminal:

# wherever you chose:
FOLDER="~/Documents/MATLAB"

git clone https://gitlab.com/jhadida/deck.git "$FOLDER/deck"
pushd "$FOLDER/deck/jmx"
bash install.sh
popd

Then from a Matlab console:

% wherever you chose
FOLDER = fullfile( userpath(), 'deck' );

addpath(FOLDER);     % !! DO NOT USE genpath() !!
dk_startup;
ant.compile();       % optional, if you want to use ant+jmx

If this gives you an error, let me know.

Finally, if you like Deck and would like to use it by default when Matlab starts, then add the following to your startup.m:

% Add Deck toolbox to the path
addpath(fullfile( userpath, 'deck' )); % or wherever you installed it
dk_startup();

Bugs & Issues

Please report new issues here (check the existing open+closed ones before posting please).

Usage

How do I call these functions?

All Deck functions can be called as if they were methods of an object dk.<submodule>.<function>( <args> ). For example: dk.util.array2string( [1,2,3], 'latex' );. Similarly for the ant library: I = imread('cameraman.tif'); ant.img.show(im2double(I));.

The functions in the jmx are prefixed with jmx_; they are mainly used to compile Mex files (see help jmx).

Undefined variable "dk" or class "dk.blah".

You installed Deck previously, and it worked, but now it doesn't? You just need to add the folder to your Matlab path again. From the Matlab console:

addpath(fullfile( userpath, 'deck' )); % or wherever you installed it
dk_startup();

Updates

If you downloaded Deck using git, you will also be able to get all future versions simply by typing from a terminal:

cd /wherever/deck/is
git pull

Then from the Matlab console:

jmx_build(); % optional, if you want to use ant+jmx
ant.compile(); 

Documentation

The documentation is being written on and off; the latest version can be found here. This is by no means a comprehensive documentation, and if you find inconsistencies between helptext and documentation, please assume that the helptext takes precedence.

Most functions have a helpful helptext, which should be enough to get you started (the code should also be fairly legible). To get help about a function, type help dk.some.function from the Matlab console. If that's not helpful, and you really want to know, open an issue asking for documentation about that particular function.

Contributions

This is free and open software; all contributions are welcome.

For contributing, you'll need a GitLab account. Also, checkout the docs to link your various computers with your account using SSH keys (avoids having to type passwords).