% the data and storing the analyzed data in another channel. % Prior to running this MATLAB code template, assign the channel variables. % Set 'readChannelID' to the channel ID of the channel to read from. Since % this is a private channel, also assign the read API Key to the 'readAPIKey' % variable. You can find the read API Key on the right side pane of this page. % To store the analyzed data, you will need to write it to a channel other % than the one you are reading data from. Assign this channel ID to the % 'writeChannelID' variable. Also assign the write API Key to the % 'writeAPIKey' variable below. You can find the write API Key in the right % side pane of this page. % TODO - Replace the [] with channel ID to read data from: readChannelID = 2184799; % TODO - Enter the Read API Key between the '' below: readAPIKey = 'xxx'; % TODO - Replace the [] with channel ID to write data to: writeChannelID = 2430287; % TODO - Enter the Write API Key between the '' below: writeAPIKey = 'yyy'; %% Read Data %% readField = 6; % Specify the field to read data = thingSpeakRead(readChannelID, 'Fields', readField, 'ReadKey', readAPIKey); %% Analyze Data %% % Add code in this section to analyze data and store the result in the % 'analyzedData' variable. analyzedData = data; %% Write Data %% writeField = 1; % Specify the field to write % Write the table to the new channel thingSpeakWrite(writeChannelID, analyzedData, 'Fields', writeField, 'WriteKey', writeAPIKey);