Creating email alert using Matlab, but getting error

Hi Team
I am trying to create native code for matlab analysis about email alert. But i am getting an error below and my code is below. Question which API key must be supplied here? The Alert API Key both on my Matlab and PostMan? I am following this link below and note my channel is set under settings as private channel.
data = thingSpeakRead(929272, "NumMinutes", 100);
aveTemp = mean(data(:,7));
apiKey = '****';
alertURL = "https://api.thingspeak.com/alerts/send";
options = weboptions("HeaderFields",["ThingSpeak-Alerts-API-Key", apiKey]);
alertBody = sprintf("The temperature is %0.2fF.", aveTemp);
if avg_temperature > 60.0
webwrite(alertURL, "body", alertBody, "subject", alertSubject, options);
end

답변 (2개)

Selva Karna
Selva Karna 2020년 1월 14일

0 개 추천

Check inbuilt funciton

댓글 수: 1

Rik
Rik 2020년 1월 14일
It is probably more helpful to provide a link to the doc page, or at least the name of the builtin function you mean. Did you mean sendmail?

댓글을 달려면 로그인하십시오.

Christopher Stapels
Christopher Stapels 2020년 1월 14일

0 개 추천

change avg_temperature to aveTemp.

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

카테고리

도움말 센터File Exchange에서 ThingSpeak에 대해 자세히 알아보기

제품

릴리스

R2019b

태그

질문:

2020년 1월 13일

답변:

2020년 1월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by