"thingSpeakRead Numminutes" is giving different size vectors for different fields | MATLAB IoT Analytics | Forum

The ThingSpeak community site has been upgraded to a new site. This site is currently in read-only mode. You can ask questions or post and read discussions on the new site.
Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
"thingSpeakRead Numminutes" is giving different size vectors for different fields
No permission to create posts
November 7, 2020
10:34 am
Avatar
Adr
New Member
Members
Forum Posts: 1
Member Since:
November 7, 2020
sp_UserOfflineSmall Offline

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.

December 15, 2020
7:10 am
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 885
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

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

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
21 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:

techhhelp5, ken, tran, huldacormier, bogart, estebanmateo93

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457