This is no longer maintained and has been superseded by datajoint-company/datajoint-docs. Please file new issues there (or help contribute!). We are currently migrating and generating new content until December 2022 after which we’ll be decomissioning https://docs.datajoint.org and https://tutorials.datajoint.org in favor of https://datajoint.com/docs/.
Install and Connect¶
Download the DataJoint MATLAB Toolbox from the MATLAB Central FileExchange.
DataJoint.mltbxand follow installation instructions.
After installation, verify from MATLAB that you have the latest version of DataJoint (3.0.0 or above):
>> dj.version DataJoint version 3.0.0
At the MATLAB command prompt, assign the environment variables with the database credentials. For example, if you are connection to the server
haha not my real password, execute the following commands:
setenv DJ_USER alice setenv DJ_HOST alicelab.datajoint.io setenv DJ_PASS 'haha not my real password'
You will need to execute these commands at the beginning of each DataJoint work session. To automate this process, you might like to use the startup.m script.
However, be careful not to share this file or commit it to a public directory (a common mistake), as it contains a your login credentials in plain text.
If you are not sure, it is better not to set
DJ_PASS, in which case DataJoint will prompt to enter the password when connecting to the database.
To change the database password, use the following command
And update your credentials in your startup script for the next session.
Other Configuration Settings¶
Starting with v0.12 (Python) and v3.3.1 (MATLAB), DataJoint will by default
use TLS if it is available. TLS can be forced on or off with the boolean
use_tls in MATLAB, or
dj.config['database.use_tls'] in Python.