필터 지우기
필터 지우기

Analysis error with input timetables

조회 수: 1 (최근 30일)
abba baab
abba baab 2023년 1월 22일
편집: Christopher Stapels 2023년 1월 29일
Why I am getting error:
Error using timetable/retime
All variables in input timetables must be numeric, datetime, or duration when synchronizing using 'mean'.
Error in ko - 1h avg to new channel (line 10)
avgdata=retime(data,'regular','mean','TimeStep',hours(hourz));
DATA EXPORT CSV LOOKS LIKE:
2023-01-21T23:47:13+02:00 45161 533 23.187 29.27 18.23 18.61 -8.5 93 -10
CODE ko - 1h avg:
dayz=1;
hourz=1;
rc=1234;
rk='KEY';
wc=5678;
wk='KEY';
data=thingSpeakRead(rc,'ReadKey',rk,'OutputFormat','timetable','numDays',dayz);
avgdata=retime(data,'regular','mean','TimeStep',hours(hourz));
thingSpeakWrite(wc,avgdata,'WriteKey',wk);
  댓글 수: 3
Walter Roberson
Walter Roberson 2023년 1월 22일
편집: Walter Roberson 2023년 1월 28일
The T is the main problem. The default formats do not support the time zone offset field but you can specify XXX as an input format to code for that. There is no direct code for the T however. You have to code 'T' for that where the apostrophes are part of the syntax. For example "uuuu-MM-dd'T'HH:mm:ssxxx"
Notice the use of " to make it easier to code the literal ' characters
abba baab
abba baab 2023년 1월 28일
편집: abba baab 2023년 1월 28일
I have not altered timestamp format. Timestamp is made automatically by Thingspeak on channel write. And it cannot read it :D :success: :lol:
Though timestamp works fine in channel graphs and in visualizations, but not with analysis.

댓글을 달려면 로그인하십시오.

답변 (0개)

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

카테고리

Help CenterFile Exchange에서 ThingSpeak에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by