November 7, 2020
I'm sending data from an instrument to this channel: 1135922, then processing it using Matlab Analysis, and writing it on this other channel 929257.
I'm reading the fields' data like this:
[fieldX,timestamps] = thingSpeakRead(readChannelID, 'Fields',1,'Numminutes',6,'ReadKey', readAPIKey)
fieldY = thingSpeakRead(readChannelID, 'Fields',2,'Numminutes',6,'ReadKey', readAPIKey)
fieldZ = thingSpeakRead(readChannelID, 'Fields',3,'Numminutes',6,'ReadKey', readAPIKey)
eulerR = thingSpeakRead(readChannelID, 'Fields',4,'Numminutes',6,'ReadKey', readAPIKey)
eulerP = thingSpeakRead(readChannelID, 'Fields',5,'Numminutes',6,'ReadKey', readAPIKey)
eulerY = thingSpeakRead(readChannelID, 'Fields',6,'Numminutes',6,'ReadKey', readAPIKey)
temperature = thingSpeakRead(readChannelID, 'Fields',7,'Numminutes',6,'ReadKey', readAPIKey)
The problem is, that every so often, the vectors end up with different number of elements with respect to each other. So, I end up having gaps in the processed data.
I have checked the data that I'm receiving from the instrument, and there is no gaps on the data. Every "timestamp" has ALL 8 fields of data, but Matlab Analysis is not reading it properly.
I wasn't having this problem with the free 15-seconds update rate, but when I upgraded to the paid license and started transmitting at about 2-3 sec, I started having the problem.
I would appreciate any help, as this is for my thesis and my deadline is in 2 weeks.
March 7, 2017
FYI, MATLAB answers is the preferred location for ThingSpeak Community support.
I've had this problem when reading from the MathWorks weather station. Since you are writing faster, there is probably a larger likelihood that there are different numbers of entries in a given number of minutes. Have a look at the read temperature in three days example in the documentation, that example shows a way to make the number of entries independent of the time range. https://www.mathworks.com/help/thingspeak/Compare-Temperature-Data-from-Three-Different-Days.html
Most Users Ever Online: 166
Currently Browsing this Page:
Guest Posters: 1
Newest Members:techhhelp5, ken, tran, huldacormier, bogart, estebanmateo93
Moderators: cstapels: 460
Administrators: Hans: 405, lee: 457