1. Script intensitate luminoasa readChannelID = ; readAPIKey = ''; [intensitate, timeStamp] = thingSpeakRead(readChannelID,'Fields', 1,'NumMinutes',1440*7,'ReadKey',readAPIKey); anyMissingValues = sum(isnan(intensitate)); if sum(anyMissingValues) > 0 missingValueIndex = find(~sum(isnan(intensitate),2)); cleanintens = intensitate(missingValueIndex, :); cleanTimeStamps = timeStamp(missingValueIndex); else cleanintens = intensitate; cleanTimeStamps = timeStamp; end avgIntens = mean(cleanintens); display(cleanintens,'Humidity'); display(avgIntens); writeChannelID = ; writeAPIKey = ''; thingSpeakWrite(writeChannelID, 'Fields', 1, 'Values', avgIntens, 'writekey',writeAPIKey); 2. Script temperatura readChannelID = ; readAPIKey = ''; [temperatura, timeStamp] = thingSpeakRead(readChannelID,'Fields', 2,'NumMinutes',30,'ReadKey',readAPIKey); anyMissingValues = sum(isnan(temperatura)); if sum(anyMissingValues) > 0 missingValueIndex = find(~sum(isnan(temperatura),2)); cleantemp = temperatura(missingValueIndex, :); cleanTimeStamps = timeStamp(missingValueIndex); else cleantemp = temperatura; cleanTimeStamps = timeStamp; end %calcule tempF = cleantemp * 1.8 + 32; avgtempF = mean(tempF); display(cleantemp); display(tempF); display(avgtempF); %scriere canal writeChannelID = ; writeAPIKey = ''; thingSpeakWrite(writeChannelID, 'Fields', 2, 'Values', avgtempF, 'writekey',writeAPIKey); 3. Script umiditate readChannelID = ; readAPIKey = ''; [umiditate, timeStamp] = thingSpeakRead(readChannelID,'Fields', 3,'NumMinutes',1440*7,'ReadKey',readAPIKey); anyMissingValues = sum(isnan(umiditate)); if sum(anyMissingValues) > 0 missingValueIndex = find(~sum(isnan(umiditate),2)); cleanumi = umiditate(missingValueIndex, :); cleanTimeStamps = timeStamp(missingValueIndex); else cleanumi = umiditate; cleanTimeStamps = timeStamp; end [a,b]=hist(cleanumi,unique(cleanumi)) avgUmi = a(2)/a(1)*100 writeChannelID = ; writeAPIKey = ''; thingSpeakWrite(writeChannelID, 'Fields', 3, 'Values', avgUmi, 'writekey',writeAPIKey); 4. Script pH % Enter your MATLAB Code below readChannelID = ; readAPIKey = ''; [ph, timeStamp] = thingSpeakRead(readChannelID,'Fields', 4,'NumMinutes',1440*7,'ReadKey',readAPIKey); anyMissingValues = sum(isnan(ph)); if sum(anyMissingValues) > 0 missingValueIndex = find(~sum(isnan(ph),2)); cleanph = ph(missingValueIndex, :); cleanTimeStamps = timeStamp(missingValueIndex); else cleanph = ph; cleanTimeStamps = timeStamp; end avgph = mean(cleanph); display(cleanph,'pH'); display(avgph); writeChannelID = ; writeAPIKey = ''; thingSpeakWrite(writeChannelID, 'Fields', 4, 'Values', avgph, 'writekey',writeAPIKey);