Unrecognised function or variable 'avg_temperature' on Matlab

2 ビュー (過去 30 日間)
Mthunzi Booi
Mthunzi Booi 2020 年 1 月 13 日
回答済み: Christopher Stapels 2020 年 1 月 14 日
Hi Team
I need some help here quickly, i have this code below. What changed here is channel setting on my channel to be public, before it was private. Now i am getting unrecognised function or variable and cant seem to solve this issue, yet i am using the new feauture for sending or creating email using Matlab https://www.mathworks.com/help/thingspeak/sendalert.html
data = thingSpeakRead(929272, "NumMinutes", 100);
aveTemp = mean(data(:,3));
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

回答 (1 件)

Christopher Stapels
Christopher Stapels 2020 年 1 月 14 日
Change avg_temperature to aveTemp.

コミュニティ

その他の回答  ThingSpeak コミュニティ

カテゴリ

Help Center および File ExchangeThingSpeak についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by