Install
Install the Shooju MATLAB Toolbox from the Shooju MATLAB Bitbucket Repo by opening it in MATLAB. Optionally use the Master Branch Toolbox for the latest version, which might not be production-ready.
- The Toolbox contains mex code to drastically speed up retrieval, so we can't publish it to MATLAB Central.
- We only compiled the mex code on Windows (32/64), so only those platforms are supported. If you're using something else, you can build it from scratch following the instructions on the Shooju MATLAB Bitbucket Repo or let us know.
Connect
- Create an API Key on the My Profile (under your name on the top-right of the website) page by using Create New API Key.
- Make note of the server (the url of the Shooju instance you log in to), username (it's on the top of the My Profile page)
- Set a Connection in MATLAB:
Shooju.Connect('http(s)-prefixed shooju url', 'my-username', 'my-api-key');
Read from Shooju
Load one or more Series by using a Queries:
res = Shooju.LoadSeries(struct('query','my-query','max_points','-1','fields','description,unit'))
A few notes on using this function:
- The only argument is a struct of parameter/values that get passed to the /series API. For a full list of available parameters, refer to the GET /series documentation at API Reference
- The result of this call is a struct with 5 fields:
Struct Key | Notes |
series | Horizontally-oriented cell array with all returned Series IDs. This is often not used in favor of more descriptive fields. |
fields | Vertically-oriented cell array with all returned fields. |
fielddata | Cell array that contains the values for each of the fields / series. The rows are fields (as defined by the fields key) and the columns are series (as defined by the series key). |
dates | Vertically-oriented cell array with all returned dates. |
pointdata | Cell array that contains the double values for each of the dates / series. The rows are dates (as defined by the dates key) and the columns are series (as defined by the series key). |
Write to Shooju
Writing is currently not supported from MATLAB. Contact us or make a pull request.
Additional Resources
See the API Reference for parameters to Shooju.LoadSeries() and the Shooju MATLAB Bitbucket Repo to review/hack the source code.