Created
June 7, 2017 11:48
-
-
Save indaco/0401e40e6753f369300b5a6fc4e41139 to your computer and use it in GitHub Desktop.
Sample Matlab script to retrieve data from the Predix Time Series and show a chart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url = '<predix-time-series-query-url-here>'; | |
options = weboptions('HeaderFields',{'Predix-Zone-Id' '<predix-time-series-one-id-here>';'Authorization' '<token-here>';'Content-Type' 'application/json';'Request-Method' 'post'}); | |
payload ='{"tags":[{"name":"<tag-name-here>"}],"start":"1y-ago"}'; | |
data = webwrite(url, payload, options); | |
plot(data.tags.results.values(:,1), data.tags.results.values(:,2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment