cesc bonet in MATLAB Answers
上次活动时间: 2025-2-28

good morning!, I'm learning in MatlLab and ThingSpeak, and I'm a bit lost ... I have a variable that changes state from 0 to 1. And I want to know how I can calculate the times it changes state, and the time that remains for Example in state 1. Can you help me? Thank you so much
Wouter Van Goey in MATLAB Answers
上次活动时间: 2023-3-17

When I try to plot temperature data over time the displayed time is two hours behind. When I try to change timezones in the following manner results are very erratic: [data, time] = thingSpeakRead(readChannelID, 'Field', fieldID1, 'NumPoints', 64, 'ReadKey', readAPIKey); %% Visualize Data %% time.TimeZone = 'Europe/Brussels' plot(time, data,'- . r'); Most timezones from this list don't change the time at all, using using some I get say one hour closer but never the right amount. What am I doing wrong? How come only a few timezones from the list even have any effect? Keep in mind I am a n00b. For the record I am using the in browser editor on thingspeak.com, running a MATLAB visualisation plotting my cloud data.
Jacob Mielczarek in MATLAB Answers
上次活动时间: 2021-8-3

Hello. I am trying to read online sensor data using the ThingSpeak API. I format my url in the following way: https://api.thingspeak.com/channels/{}/feeds.csv?api_key={}&average=60&offset=0&round=2&start=2021-04-01 00:00:00&end=2021-07-31 00:00:00 Where the two '{}' are replaced with the channel ID and read Key respectively. The problem is that the data returned only spans about 10 days which is only a fraction of what the url specified. Is there a way to avoid this limit and retrieve all the data requested in a single call, or do multiple API calls have to be made if the timeframe I need is greater than 10 days? Thank you in advance!
Mars Rap in MATLAB Answers
上次活动时间: 2020-6-9

I have a CSV generated from ThingSpeak, which contains a datetime containing a time zone identifier (CEST in my case). It looks like this: created_at,entry_id,field1,field2,field3,latitude,longitude,elevation,status 2020-06-06 18:36:17 CEST,1,434,2.12121212121,30.3487192708,,,, 2020-06-06 18:36:33 CEST,2,433,2.11632453568,30.2823285934,,,, 2020-06-06 18:36:48 CEST,3,436,2.13098729228,30.4815006257,,,, 2020-06-06 18:37:03 CEST,4,433,2.11632453568,30.2823285934,,,, Now, when I edit the file and remove " CEST" from all rows, readtimetable imports the file properly, with no issues. But when I leave it as is, readtable imports the field as text, while readtimetable refuses altogether. I tried to specify the format manually, as so: opts.VariableNames = ["created_at", "Var2", "field1", "Var4", "Var5", "Var6", "Var7", "Var8", "Var9"]; opts.SelectedVariableNames = ["created_at", "field1"]; opts.VariableTypes = ["datetime", "string", "double", "string", "string", "string", "string", "string", "string"]; opts = setvaropts(opts, "created_at", "InputFormat", "dd-MM-yyyy HH:mm:ss z", "TimeZone", 'Europe/Warsaw'); With this, readtimetable works but... all fields are turned into NaT. Now, this is some weird behavior, because using the datetime function with one of those fields copied works flawlessly: >> date = datetime("2020-06-06 18:36:17 CEST","InputFormat","yyyy-MM-dd HH:mm:ss z","TimeZone","Europe/Warsaw") date = datetime 06-Jun-2020 18:36:17 Matlab's importer also can't handle it, when I use the CSV file as the input it wrongly detects the delimiter, once that's corrected and field type set to datetime, any way I tried configuring the input format just fails and results in NaTs. I even attempted to set the format to "yyyy-MM-dd HH:mm:ss 'CEST'", so the time zone gets treated as a string, but it still fails to recognize it as a correct datetime. Using Matlab R2020a
Marek Hamza in MATLAB Answers
上次活动时间: 2020-1-5

Hello! How do I pick up a data in the specific time period through all the days back? This is my code so far... % set time range from 8H to 12H of every day S = timerange('08:00:00','12:00:00'); % Read Temperature Data data = thingSpeakRead(readChannelID,'Fields',TemperatureFieldID, ... 'timerange',S, 'ReadKey',readAPIKey); % Calculate the maximum and minimum temperatures in the period [maxTempF] = max(data); [minTempF] = min(data); I would be so happy for any ideas :)

关于 ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.