10:01 am


Moderators
March 7, 2017

Have a look at this code:
https://www.mathworks.com/help/thingspeak/calculate-average-humidity.html
This code is for average, but you can replace that with a sum. It will show you how to read and process the data. Also there is a template for it when you create a new MATLAB analysis.
8:42 am


Moderators
March 7, 2017

Are you looking to add a column of index labels to your exported data? If you use a timetable, you can probably easily append this index.
Here is an example using the cheerlights channel:
myTable=thingSpeakRead(1417,'numPoints',15,'outputFormat','timetable');
index=(1:15);
myTable=addvars(myTable,index','before',1);
You can index into MATLAB matricies, arrays, and even timetables though, you don't actually need row numbers, unless you are just looking to add that for display reasons.
Most Users Ever Online: 166
Currently Online:
36 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
rw950431: 272
Vinod: 240
piajola: 95
turgo: 70
vespapierre: 63
Adarsh_Murthy: 62
Member Stats:
Guest Posters: 1
Members: 8665
Moderators: 1
Admins: 2
Forum Stats:
Groups: 3
Forums: 14
Topics: 1600
Posts: 5760
Newest Members:
Advantagetreeexperts, laundrydaddyuk, techhhelp5, ken, tran, huldacormierModerators: cstapels: 460
Administrators: Hans: 405, lee: 457