The installation of JSONLab is no different from installing any other MATLAB toolbox. You only need to download/unzip the JSONLab package to a folder, and add the folder's path to MATLAB/Octave's path list by using the following command:
addpath('/path/to/jsonlab');If you want to add this path permanently, you can type
pathtool
, browse to the JSONLab root folder and add to the list, then click "Save". Then, run rehash
in MATLAB, and type which savejson
, if you see an output, that means JSONLab is installed for MATLAB/Octave.
If you use MATLAB in a shared environment such as a Linux server, the best way to add path is to type
mkdir ~/matlab/ nano ~/matlab/startup.mand type
addpath('/path/to/jsonlab')
in this file, save and quit the editor. MATLAB will execute this file every time it starts. For Octave, the file you need to edit is ~/.octaverc
, where ~
is your home directory.
To use the data compression features, please download the ZMat toolbox from https://github.com/NeuroJSON/zmat/releases/latest and follow the instruction to install ZMat first. The ZMat toolbox is required when compression is used on MATLAB running in the -nojvm
mode or GNU Octave, or 'lzma/lzip/lz4/lz4hc' compression methods are specified. ZMat can also compress large arrays that MATLAB's Java-based compression API does not support.
JSONLab has been available as an official Fedora package since 2015. You may install it directly using the below command
sudo dnf install octave-jsonlabTo enable data compression/decompression, you need to install
octave-zmat
using
sudo dnf install octave-zmatThen open Octave, and type
pkg load jsonlab
to enable jsonlab toolbox.
JSONLab is currently available on Debian Bullseye. To install, you may run
sudo apt-get install octave-jsonlabOne can alternatively install
matlab-jsonlab
if MATLAB is available.
JSONLab is currently available on Ubuntu 21.04 or newer as package <span class="title-ref">octave-jsonlab</span>. To install, you may run
sudo apt-get install octave-jsonlabFor older Ubuntu releases, one can add the below PPA
https://launchpad.net/~fangq/+archive/ubuntu/ppa
To install, please run
sudo add-apt-repository ppa:fangq/ppa sudo apt-get updateto add this PPA, and then use
sudo apt-get install octave-jsonlabto install the toolbox.
octave-zmat
will be automatically installed.
JSONLab is also available on Arch Linux. You may install it using the below command
sudo pikaur -S jsonlab