how to send data uploaded to ubidots to matlab?
Good day @DIEGO21
Thank you for sharing your question with the community.
Please refer to the below article to learn about the integration of MATLAB with Ubidots. This article will help you to know how to use MATLAB to send data to Ubidots using the âwebwriteâ function. If what you want to do is to send Data from Ubidots to MATLAB, there should be a âwebreadâ (although Iâm not well versed in MATLAB) function too.
If instead youâd like something like a native Matlab MQTT client, it seems like this feature is tied up and restricted to only work with Mathworkâs IoT Platform, ThingSpeak.
All the best,
Ăngela
just use webread
instead of webwrite
:
resource = 'http://industrial.api.ubidots.com/api/v1.6/devices/matlab?token=your-token'
response = webread(resource)
Source:
https://www.mathworks.com/help/matlab/ref/webread.html
@jotathebest, thanks for your comment and direction. To complement your answer, the resource URL to retrieve variable data should be as follows:
resource = 'http://industrial.api.ubidots.com/api/v1.6/devices/matlab/<variable-label>/values?token=your-token'
@DIEGO21 bear in mind that youâll need to replace <variable-label>
with an actual variable label of your matlab
device. Also, it is worth mentioning that the /values
endpoint will retrieve the last 100 Dots of the variable, so in order to further filter the request, please make use of the query params as explained here