Barnard Richards in MATLAB Answers
上次活动时间: 2020-7-1

Firefox 77.0.1 does not allow editing in code window but Chrome Version 83.0.4103.116 works OK Make a MATLAB Analysis to Send Email First get your ThingSpeak Alerts API key from the Account > My Profile The alerts API key will start with ‘TAK’. Create a new MATLAB analysis at Apps > MATLAB Analysis. Click the New button on the top. Choose the blank template and with this code. alert_body = 'This is the text that will be emailed'; alert_subject = 'This will be the subject of the email'; alert_api_key = 'YOUR_API_KEY_FROM_STEP_1'; alert_url= "https://api.thingspeak.com/alerts/send"; jsonmessage = sprintf(['{"subject": "%s", "body": "%s"}'], alert_subject,alert_body); options = weboptions("HeaderFields", {'Thingspeak-Alerts-API-Key', alert_api_key; 'Content-Type','application/json'}); result = webwrite(alert_url, jsonmessage, options); Adjust the alert body, subject and API key.

关于 ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.