'Values' must have a maximum of 9 elements, including the timestamp. My data only send up to 9 data to thingspeak and this error occur.

1 次查看(过去 30 天)
Hi. Im trying to send data from matlab which is the data from serial monitor from arduino. It is fine until 9th of data and then it stopped and says :
Error using Untitled (line 27)
'Values' must have a maximum of 9 elements, including the timestamp.
My coding is:
clear all
s = serial('com4');
fopen(s);
i = 1;
while(1)
data(i)= str2double(fscanf(s));
plot(data);
title('Temperature Monitoring')
xlabel('Time')
ylabel('Temperature')
pause(15);
i=i+1;
%thingSpeakWrite(1463959,data,'WriteKey','9OUSQA9OXZU0EO4X')
% Generate timestamps for the data
%tStamps = datetime('now')-minutes(9):minutes(1):datetime('now');
channelID = 1463959; % Change to your Channel ID
writeKey = 'xxxxxxxxxxxxxxxx'; % Change to your Write API Key
% Write 10 values to each field of your channel along with timestamps
tStamp = datetime('now')
thingSpeakWrite(1463959,data,'WriteKey','xxxxxxxxxxxxxxx','TimeStamp',tStamp)
end

回答(0 个)

社区

更多回答在  ThingSpeak Community

类别

Help CenterFile Exchange 中查找有关 Read Data from Channel 的更多信息

产品


版本

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by