У меня есть следующий код на моем Matlab, теперь я получаю индекс в позиции 2 превышает границы массива. Как я могу улучшить это?
data = thingSpeakRead(929272, "NumMinutes", 100);
aveTemp = mean(data(:,2)); // This line is the one, i got two fields from my thingspeak channel
apiKey = 'O6P4N8AVZWKNGK5U';
alertURL = "https://api.thingspeak.com/alerts/send";
options = weboptions("HeaderFields",["ThingSpeak-Alerts-API-Key", apiKey]);
alertBody = sprintf("The temperature is %0.2fF.", aveTemp);
alertSubject = sprintf("! Temperature exceeded 60.0F!");
if avg_temperature > 60.0
webwrite(alertURL, "body", alertBody, "subject", alertSubject, options);
end