ThingSpeak

ThingSpeak

Public Channel

William Glass in MATLAB Answers
Last activity on 9 Nov 2026 at 17:52

Hello: Using the Timecontrol app, I want to execute a MatlabAnalysis recurring daily at 6:00 A.M. but execute it only ONCE. The MatlabAnalysis code performs a Thingspeakwrite() to a channel. I have the impression that the execution of this code is called multiple times during minute 00. I cannot write to a field more than every 30 seconds i believe. What can I do? Thanks in advance! Below is my MatlabAnalysis code: NHRS=6; disp(['process the last ' num2str(NHRS) ' hours of pool level measurements']); channelID = xxxxxx; [data timestamps]= thingSpeakRead(channelID, 'NumPoints', 100, 'Fields', 5); ts=timestamps; indx=find(~isnan(data)); data1=data(indx); ts1=ts(indx); [N dummy]=size(data1); [data2]=data1(N-NHRS+1:N); ts2=ts1(N); %disp('last 24 pool data levels'); %disp(data2); disp(' '); disp('time stamp of last pool level measurement'); disp(ts2); % Calculate the average avgValue = mean(data2); % display the aveage disp(['mean: ' num2str(avgValue) ' cm']); % calcul the std deviation sd=std(data2,1); %display the std deviation disp(['sd: ' num2str(sd) ' cm']); thingSpeakWrite(xxxxxx,[avgValue,sd],'WriteKey','xxxxxx');

About 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.