Quantcast
Channel: ThingSpeak IoT Community - Forum: ThingSpeak Apps
Viewing all articles
Browse latest Browse all 223

Adarsh_Murthy on Can't use data from thingSpeakRead to parse comma delimited values

$
0
0

Hi, 

thingSpeakRead() by default returns data back as a numeric array. For your case, since the data on the ThingSpeak channel is a string, you should use the 'OutputFormat' names parameter to request for data back as a table:

data = thingSpeakRead(readChannelID,'ReadKey', readAPIKey,'NumPoints', 1, 'Fields', [1], 'OutputFormat', 'table');

You will then need to access the data in the table (data.<columnName>) to apply strsplit() function. Refer to the following link on how to access data in a table:

https://www.mathworks.com/help/matlab/ref/table.html

https://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-table.html

 

If this doesn't work, share the values stored in the data table and we might be able to provide additional suggestions.

 

HTH!


Viewing all articles
Browse latest Browse all 223

Trending Articles