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

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

$
0
0

Hello,

I'm finding the reference for thingSpeak extremely lacking so I have turned here in exasperation.

I am using the thingSpeakRead() function to read the most recent value from Field 1 of my private channel.  The data that this field stores is a string of comma-separated values.

I want to take this list of values, parse them, and write them to their corresponding field on a different private channel I own.

I have the following code:

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

dataArray = strsplit(data, ',');

 

If I try and run this code, I get the following error message in the "Output" box:

Error using strsplit
First input must be either a character vector or a string scalar.

So, obviously the data that thingSpeakRead() returned was not a string (or "character vector" as I guess MATLAB calls it...).

Not sure where to go from here.... is there a way to access this string of values stored in Field 1?Cry


Viewing all articles
Browse latest Browse all 223

Trending Articles