嗨。我试图从matlab发送数据,这是从arduino串行监视器的数据。在9号数据之前它是好的,然后它停止并说:
使用Untitled时出错(第27行)
'Values'必须有最多9个元素,包括时间戳。
我的编码是:
清除所有
s =串行(“com4为”);
fopen (s);
i = 1;
而(1)
数据(i)=str2double(fscanf(s));
情节(数据);
标题(温度监控)
包含(“时间”)
ylabel(‘温度’)
暂停(30);
我=我+ 1;
% thingSpeakWrite(1463959、数据“WriteKey”,“9 ousqa9oxzu0eo4x”)
%为数据生成时间戳
%tStamps=datetime('now')-分钟(9):分钟(1):datetime('now');
channelID=1463959;%更改为您的频道ID
writeKey = ' 9 ousqa9oxzu0eo4x ';%更改你的写API密钥
%向通道的每个字段写入10个值和时间戳
tStamp=datetime('now')
thingSpeakWrite(1463959,数据,'WriteKey','9OUSQA9OXZU0EO4X','TimeStamp',tStamp)
结束