Mi He2 in MATLAB Answers
上次活动时间: 2025-5-18

Over the past few days, I’ve observed that MATLAB visualizations on ThingSpeak are not rendering correctly when accessed via the public URL. When I run the MATLAB Visualization script manually within ThingSpeak, the resulting image has the correct resolution and aspect ratios. However, accessing the same visualization through the public URL generates a much smaller image with distorted proportions. The script itself hasn’t been modified for a long time, and this issue has only started occurring recently. Could this be related to a recent change in the rendering engine or visualization settings on ThingSpeak? I would appreciate any guidance or insight into what might be causing this discrepancy. Thank you!
Zaka in Discussions
上次活动时间: 2024-9-25

hope this message finds you well. I am currently working on a project involving the design and numerical simulation of metalenses using Zemax and MATLAB. The design phase involves saving phase data from the Zemax simulation, which is later used in a numerical script to generate the metalens in MATLAB. I have a MATLAB file that contains the phase data saved from Zemax, but I am unsure of the specific method or format used to extract and save the data from Zemax. The phase data I currently have in MATLAB is as follows: Phase matrix: 571 x 571 (double) X data: 571 x 1 (double) Y data: 571 x 1 (double) Could you please provide guidance on: How this phase data was likely saved from Zemax into MATLAB? What steps or scripts were used to extract this information from the design, particularly the 571 x 571 phase matrix and the corresponding X and Y data? Any best practices or tools available in Zemax for exporting such data? This information will help me reproduce the workflow and proceed with my analysis. Thank you for your support. I look forward to your guidance. Best regards, Zaka Request for Assistance on Extracting and Saving Phase Data from Zemax into Matlab file zemax matlab
MD..Sign in MATLAB Answers
上次活动时间: 2024-6-4

Hello, can anyone please check, if the MATLAB Visualizations are right now offline for everyone or just for me? I've made 2 visualizations and both show the "broken image" icon instead of the graph. The problem occurred half an hour ago or so - I do not know exactly. As you can see, widgets are not affected. Both visualizations are public and can be "Save an Run" with "MATLAB code ran successfully." as status. Here is one of the MATLAB codes that has worked flawless till it stopped: % Template MATLAB code for visualizing data using the YYAXIS and PLOT functions. % Prior to running this MATLAB code template, assign the channel variables. % Set 'readChannelID' to the channel ID of the channel to read from. % Also, assign the read field IDs to the variables 'fieldID1', and 'fieldID2'. % TODO - Replace the [] with channel ID to read data from: readChannelID = [********]; % TODO - Replace the [] with the Field ID to read data from: fieldID1 = [3]; % TODO - Replace the [] with the Field ID to read data from: fieldID2 = [5]; % Channel Read API Key % If your channel is private, then enter the read API % Key between the '' below: readAPIKey = '***********'; %% Read Data %% % Read first data variable [data1, time1] = thingSpeakRead(readChannelID, 'Field', fieldID1, 'NumPoints', 600, 'ReadKey', readAPIKey); % Read second data variable [data2, time2] = thingSpeakRead(readChannelID, 'Field', fieldID2, 'NumPoints', 600, 'ReadKey', readAPIKey); %% Visualize Data %% yyaxis left; plot(time1, data1) xlabel('Zeit'); ylabel('Watt'); yyaxis right; plot(time2, data2); xlabel('Zeit'); ylabel('Ampere'); title('Phase 2 - Watt & Ampere'); grid on; Any help is appreciated - thanks in advance! MD
Dion Guek in MATLAB Answers
上次活动时间: 2024-6-4

This string of code is taken from the thingSpeak documentation for matlab. I just copy and paste but still got this error. I would very much appreciate it if anyone can tell me where i did wrong <</matlabcentral/answers/uploaded_files/94486/error.JPG>>
Hsu Yung-Cheng in Discussions
上次活动时间: 2024-2-23

When I embed Matlab windows into C#, I use C# to call the mouse functions such as drawline() and getpts() which are encapsulated in Matlab's dll, and then the program crashes, how can I solve this problem? ps : The functions that I call in C# can be executed in Matlab. ps : If I don't embed the window into C#, but just let C# call the Matlab function, it can execute the mouse control normally in the window, but once embedded into the C# window, it will crash when execute the mouse command. Encapsulating Matlab's Mouse Control Functions for C# I think I know why. It's because it conflicts with the C# UI thread. So I will try to call it in an asynchronous way I solved this problem by using an asynchronous thread (async). The reason it happens is that it gets stuck with the C# UI thread. matlab c
Abhishek in Discussions
上次活动时间: 2024-2-20

Hi Everyone. I am facing a problem while connecting the FMU to the buses. I have one FMU which expects 9 inputs and I did clarify the same while using bus creator. But in the end i am getting this error which i am trying to solve for couple of hours but didn't get any solution. So if any knows about the same please help me. I would give details as well if you need any other information. Problem with linking bus to the FMU (Functional Mockup Unit) in Simulink Please consider posting this question on MATLAB answers, you will get better response. This forum is designed for IoT devices and cloud device workflows. Hi. Thanks I will do that. simulink fmu matlab
Mi He2 in MATLAB Answers
上次活动时间: 2023-10-24

how should I take a screenshot of a matlab visualization and send it to myself by email? Once a day I would like to "print" a visualization chart and ideally send it by email. Is it possible to make by script? Thank you.
Aqsal Renaldi in MATLAB Answers
上次活动时间: 2023-9-18

when i try to use analog read to read a sensor and connect it to thingspeak, the value is always 4095. but when i only use the analog read without the thingspeak program, it works normal. did anyone know whats wrong? here is my program : #include "WiFi.h" #include "ThingSpeak.h" int ldr = 14; int nilai; #define CHANNEL_ID "my number" #define CHANNEL_API_KEY "my key" WiFiClient client; #define WIFI_NETWORK "name" #define WIFI_PASSWORD "pass" #define WIFI_TIMEOUT_MS 2000 void connectToWiFi(){ Serial.print("Connecting to WiFi"); WiFi.mode(WIFI_STA); WiFi.begin(WIFI_NETWORK, WIFI_PASSWORD); unsigned long startAttemptTime = millis(); while(WiFi.status() != WL_CONNECTED && millis() - startAttemptTime < WIFI_TIMEOUT_MS){ Serial.print("."); delay(100); } if(WiFi.status() != WL_CONNECTED){ Serial.print("Failed"); }else{ Serial.print("Connected"); Serial.println(WiFi.localIP()); } } void setup() { pinMode(ldr, INPUT); Serial.begin(9600); connectToWiFi(); ThingSpeak.begin(client); } void loop() { nilai = analogRead(ldr); Serial.print("Nilai LDR :"); Serial.println(nilai); ThingSpeak.writeField(CHANNEL_ID, 1, nilai, CHANNEL_API_KEY); delay(15000); }
Edward in MATLAB Answers
上次活动时间: 2023-8-9

I have set up thingspeak and am successfully visualising data from arduino etc. is there an app I can use on my iPhone rather than having to connect via the browser. If so what is it called so I can download and set up please
Pedro in Discussions
上次活动时间: 2023-7-18

Good morning, I am trying to send a long number to a channel convert it to a string once received. The number, as an example, might look like this: field1=100630000553400000000 However, if I input it to a matlab analyze in thingspeak, i get it either as a number in scientific notation, or it is giving me a different number if I convert it using functions like mat2str, compose, num2str, etc. In the case of the number above, i get numbers like: field1=0100630000553399992320 It looks like the numbers are pretty close or there is some strange rounding going on. I am sending the field from a desktop mqtt server so the value is set by me. Is there something I should consider when sending such long numbers? Thanks! Reading long numbers in thingspeak Can you share your code to read the number (and perhaps your channel ID if it is public?) The key is when the string to number conversion is happening. I recommend keeping it a string at long as possible to keep the literal digits. Thank you for your help. The channel ID is 2221937. I made it public so you can see the message received. When I read your field 1 data, I see {"created_at": "2023-07-17T09:52:45-04:00","entry_id": 2,"field1": "100630000609200000099"}, Based on your criteria above, this looks like what you hoped for? Can you confirm if that is what you expect? Are you reading it into MATLAB and then printing there? Can you share the code youy use to read tha values? This is my code, i wil change the API key later. You can check the result register variables does not match what we can normally read using https://api.thingspeak.com/channels/2221937/feeds.json?results=2 % Enter your MATLAB code below % Channel ID to read data from readChannelID = 2221937; % Channel Read API Key % If your channel is private, then enter the read API % Key between the '' below: readAPIKey = 'VEMNQ70TRRNSVL1O'; format long registers2 = num2str(thingSpeakRead(readChannelID,'Fields',1,'ReadKey',readAPIKey),25) registers2 = num2str(thingSpeakRead(readChannelID,'Fields',2,'ReadKey',readAPIKey),25) registers3 = num2str(thingSpeakRead(readChannelID,'Fields',3,'ReadKey',readAPIKey),21) registers4 = num2str(thingSpeakRead(readChannelID,'Fields',4,'ReadKey',readAPIKey),21) registers5 = num2str(thingSpeakRead(readChannelID,'Fields',7,'ReadKey',readAPIKey),21) took me a little bit of futzing, but I got this: url='https://api.thingspeak.com/channels/2221937/feeds.json?results=1' kim=webread(url) registers1 = kim.feeds.field1 registers2 = kim.feeds.field2 ... also consider using thingSpeakRead with 'outputformat','timetable' when you want to read string type data. url='https://api.thingspeak.com/channels/2221937/feeds.json' btw, you dont need the api key if the channel is set to public. Thank you, Christopher! I will give it a shot today. I tried changing the output format but it was still showing as scientific notation. matlab long number string
Ruben Capuli in MATLAB Answers
上次活动时间: 2023-5-31

Can I use my academic license in matlab to have academic license in thingsspeak or do I have to purchase the license for thingsspeak seperately?
Alaa in MATLAB Answers
上次活动时间: 2023-5-30

I'm working on a project that contains several distributed nodes. I assigned one channel for each node. my question is " how can I visualize the data coming from different channels on one page?
Roxy in MATLAB Answers
上次活动时间: 2023-5-7

I am trying to collect battery voltage data from arduino parts and upload it from arduino into my Thingspeak channel. So far, I have troubleshot the hardware/wiring aspect, and that doesn't seem to be the issue. At this point, I am assuming the issue is with the code or the Thingspeak channel. Since my arduino board (elegoo arduino Uno R3) is hooked up to my computer using a USB cord, I tried using an HTTP GET request in order to send the information to the Thingspeak channel. I am under a time crunch and am unable to access any kind of Wifi or Ethernet shield, so that is why I am using the USB cord. I could be completely wrong in using the HTTP GET request --I am quite the novice here! Here is the code so far: #include <SoftwareSerial.h> SoftwareSerial Serial1(2, 3); // RX, TX // Define variables float voltage; unsigned long previousMillis = 0; const long interval = 60000; // Upload interval (in milliseconds) String apiKey = "P5LPXSRJT0G4K7VA"; String field = "field1"; String server = "api.thingspeak.com"; String channelID = "2131761"; void setup() { Serial.begin(9600); Serial1.begin(9600); } void loop() { // Read voltage from sensor voltage = analogRead(A0) * 0.0049; // convert analog reading to voltage (0-5V) voltage = voltage * 5.17; // adjust the voltage to reflect the actual voltage // Print voltage to serial monitor Serial.print("Voltage: "); Serial.print(voltage); Serial.println(" V"); // Get current timestamp unsigned long currentMillis = millis(); // Check it's time to upload to ThingSpeak if (currentMillis - previousMillis >= interval) { // Update timestamp previousMillis = currentMillis; // Construct HTTP GET request String getRequest = "GET /update?api_key="; getRequest += apiKey; getRequest += "&"; getRequest += field; getRequest += "="; getRequest += String(voltage); getRequest += "&"; getRequest += "field2=Times"; getRequest += " HTTP/1.1\r\n"; getRequest += "Host: "; getRequest += server; getRequest += "\r\n"; getRequest += "Connection: close\r\n\r\n"; getRequest += "X-THINGSPEAK-CLIENT: arduino\r\n"; getRequest += "Content-Type: application/x-www-form-urlencoded\r\n"; getRequest += "Content-Length: "; getRequest += String(voltage); getRequest += "\r\n"; getRequest += "Host: api.thingspeak.com\r\n"; getRequest += "User-Agent: Arduino/1.0.0\r\n"; getRequest += "\r\n"; getRequest += "\r\n"; getRequest += channelID; // Send HTTP GET request to ThingSpeak via serial communication Serial1.println(getRequest); // Print response from ThingSpeak to serial monitor while (Serial1.available()) { Serial.write(Serial1.read()); } Serial.println(); } delay(1000); } Again, I really have no clue what I am doing here, so I am not surprised if what I have is entirely wrong. Any feedback is greatly appreciated!
Alejandro Sanz in Discussions
上次活动时间: 2023-4-27

I'm running the same code as a week ago but now it reports the error: MATLAB code has timed out. MATLAB code has timed out Oh good it's not just me then. Must be a wider problem with matlab analysis timing out Ill check if we are having extra timeout activity, but the cause could be in part due to your own network latency. If you share parts of your code here, we can try to help optimize it. Just in case you are interested, the paid license options have longer time outs. We did just have a small issue that was just resolved. If you continue to see ploblems, please post again here. You can track outages for all MathWorks products at status.mathworks.com matlab
University of the Incarnate Word in MATLAB Answers
上次活动时间: 2023-2-7

I have two seperate temperature sensors connected to arduino and I would like for them to read data on the same field in Thingspeak. For example, have one graph showing two lines on it in different colors, each representing one of the temperature sensor data. Is this possible? If so, how can it be done? Thank you
Pedro in Discussions
上次活动时间: 2023-1-25

Hi, what would be the best approach to use the gauge widget to display calculated data? I have a channel that displays a value that needs some math applied to it to give a correct value. I have a matlab visualization that converts this value into what I need and plots it. However, i believe a gauge is more appropriate than a plot and it seems the matlab "uigauge" object does not work for thingspeak. Is there a way for the gauge widget to show my data coming out of the matlab script? Thanks! Gauge widget with matlab data There is a Gage widget built into thingSpeak. On the channel view, select Add Widget, and choose the gage widget. Select the channel, field, and propoerties of the gage widget and the channel where you want it to be displayed. See the widget help for more info. Hi Christopher, thank you for the feedback. I understand that there is a built in feature for that, but it seems seems like it only works for data from the fields that I publish. I wanted to have a gauge to show the result of a matlab script. Say if a channel publishes a 0-100 value, but I use matlab to conver it to a value between 5-35. How could I add a gauge for that? Are you using desktop MATLAB, or MATLAB analysis/viz in ThingSpeak? Either way, after the conversion, you can write back to a new channel and set the gage to read from that new channel. You can also write code in MATLAB to generate a gage visualization for you. A polar plot makes a good start. I mean in MATLAB analysis/viz in ThingSpeak. In regular MATLAB I can create a gauge with uigauge with no issues. I just wanted to see if I could do the same in ThingSpeak but it seems like I will have to write to a different channel. Most UI elements arent allowed in ThingSpeak due to the interface. I have some fairly medium quality gage code that would work in a MATLAB viz, Ive been meaning to post it on file exchange. Thanks for the push. Would something like this work for you? Its a MATLAB function you can run in ThingSpeak to make a gage in a MATLAB viz Absolutely! Thanks for your help! Im not going to get around to putting this on File exchange becasue its too sloppy of a solution, but if it works for you, here is the silly function I wrote (be careful if you use small numbers, the rounding will kill it). % Sample call mygage(475,1,3000,0,1200,1200,1800,1800,2800,25); function MakeGage = mygage(value, lowRange,highRange,greenLow,greenHigh,yellowLow,yellowHigh,redLow,redHigh,nTicks) % TODO range cannot be less than 1 due to rounding fullRange = highRange - lowRange; greenStart = 230 - (360-80) / fullRange * (greenLow - lowRange); greenEnd = 230 - (360 - 80) / fullRange * (greenHigh - lowRange); yellowStart = 230 - (360 - 80) / fullRange*(yellowLow - lowRange); yellowEnd = 230 -(360 - 80) / fullRange * (yellowHigh - lowRange); redStart = 230 - (360 - 80) / fullRange * (redLow - lowRange); redEnd = 230 - (360 - 80) / fullRange * (redHigh - lowRange); tickMove = fullRange / nTicks; green = [greenStart:-5:greenEnd]; green = green*2*pi/360; rgreen = ones(1,size(green,2)); polarplot(green, rgreen,'g','LineWidth',16); hold on yellow = yellowStart:-5:yellowEnd; yellow = yellow*2*pi/360; ryellow = ones(1,size(yellow,2)); polarplot(yellow, ryellow,'y','LineWidth',16); red = redStart:-5:redEnd; red = red*2*pi/360; rred = ones(1,size(red,2)); polarplot(red, rred,'r','LineWidth',16); valueAngle = 230 - (360-80) / fullRange * (value - lowRange); rblack = [0:0.1:1]; black = valueAngle * 2 * pi/360 * ones(1,size(rblack,2)); polarplot(black, rblack,'k','LineWidth',5); ax = gca; ax.RTickLabel = []; ax.RGrid = 'off'; width = 280 / nTicks; tickHold = 0:width:280; tickHold = tickHold-50; tickHold = [tickHold(tickHold>=0),tickHold(tickHold<0)+360]; ax.ThetaTick = tickHold; %ax.ThetaTick=[0:width:230,310:width:360]; tickLabels = round([highRange:-tickMove:lowRange],0); shift = round(50 / width); tickLabels = circshift(tickLabels,-shift); ax.ThetaTickLabel = tickLabels; ax.RLim = [0,1.05]; text(265*2*pi/360,0.8,string(value),'fontSize',20); hold off end matlab widgets gauge
rene in Discussions
上次活动时间: 2022-12-6

hello, how i can show module image in to public view. in widget public dont show the option. exist any code for MATLAB? show channel image in public view Right now, images can only be shown on the private view of your channel. There are functions to read images into MATLAB planned for a future release. hi thank you, i can ask here about email notify, im trying add a alert when new image is upload. but maybe is not possible whith no MATLAB functions. i see another options for external email or sms i need study. There is an email alerts service built in to ThingSpeak, but Id prefer you ask a new question about it, specifically asking what you would like to do. It would probably be better to use the MATLAB answers section below unless you are looking to start a borad discussion about the feature and your project. image channel public view matlab
Frederic Lhoest in Discussions
上次活动时间: 2022-11-18

Dear Community, I'm now on ThingSpeak for nearly 4 weeks and I'm struggling to compute some MATLAB data. Mostly because I don't know the syntax. I have a hourly graph of solar production in kW, I'm taking a sample every 20 seconds, and I would like to aggregate the data on a daily basis in kWh. I guess I need to select the last 7 days of data using some thingsread function, add the data into an array and compute the daily data into an average/sum ... As you can see, I mostly got the mechanics but I'm struggling to create the car ;) Is there anyone kind enough to assist me ? Thansk a lot ! How to compute and aggregate energy production Here it is in two glorious lines. Ive done it using the traffic monitor channel, since it posts data every 15 seconds, you can't read 7 days in one try. myData=thingSpeakRead(38629,'numdays',2,'outputformat','timetable'); newData=retime(myData,'hourly','sum'); Wow .... Ok let me try on my side and I'll let you know what I came up with ! Ok, so I gave it a try but without luck : Here is the code section : %% Read Data %% [data, time] = thingSpeakRead(readChannelID, 'Field', fieldID1, 'NumDays', 2, 'ReadKey', readAPIKey); newData=retime(data,'hourly','sum'); %% Visualize Data %% plot(time, newData); title("Last 2 days Aggregation"); xlabel("Time"); ylabel("Production (Wh)"); I'm having this error : Incorrect number or types of inputs or outputs for function 'retime'. Error in aggregate (line 21) newData=retime(data,'hourly','sum'); In case of you wonder, Line 21 is where retime is used. Look at what else is different about the code I gave you, especially in the first line. I understood, I'm using an array with 2 dimensions ? right ? I'm sorry I'm discovering this language... Sure, welcome to MATLAB. Also look the the name, value pairs I used at the end to get a timetable output. The retime function needs a timetable to act on. You can see those requirements in the doc. MATLAB has famously good doc. I'm sorry but I'm still not able to do anything :-/ Please show me what you tried and what result you are getting. Here is some updated code. myData=thingSpeakRead(readChannelID,'numdays',2,'outputformat','timetable'... ,'ReadKey', readAPIKey); newData=retime(myData,'hourly','sum'); %% Visualize Data %% plot(newData.Timestamps, newData.(1)); title("Hourly Aggregation"); xlabel("Time"); ylabel("Production (Wh)"); Hi Christopher, Thanks a lot. I know what's hapening ... Matlab is too powerful ;) So, I have the data plot now, how can I geet a full week ? I can seemax 3 days. I know you're stating above I cannot see 7 days in one try, can you elaborate on that ? Since we are aggregating data now, we should have less data in one go ? Can you try the MATLAB onramp? Its really helpful to get going. If you still have troubles after that, consider starting a new thread on MATLAB answers. matlab aggregating data solar production formula help
Christopher Stapels in Discussions
上次活动时间: 2022-10-10

Hopefully you are aware that MATLAB is built into ThingSpeak. Right now, MathWorks is hosting two contentsthat can help you learn MATLAB and then improve your IoT project. I just set a calendar reminder to do a Cody problem each day. I can't win a prize but I can still get a virtual badge if I get a streak going. Even if you dont enter, the mini hack image gallery is pretty interesting to look around. Community contests to help you improve your MATLAB coding skills contest matlab cody mini-hack
보은 이 in Discussions
上次活动时间: 2022-9-19

I have a data. And, I want to substract the data using for. But, I want to ignore the nan values and substract others. For example, [1, 2, 3, NaN, 6, 9, 12, 14] ---- substract---> [1, 1, 3, 3, 2] How can I do this? I want to ignore nan values and substract others. What is the expected answer? I'm not clear what you mean by subtract for arrays. [1,2,3,6,9,12,14] - [ 1,1,3,3,2] =? Here is how you can clean the nan values though: A=[1, 2, 3, NaN, 6, 9, 12, 14]; AnoNan=A(~isnan(A)); B = [1, 1, 3, 3, 2]; BnoNan=B(~isnan(B)); Thanks for your answer! I want to this. A=[1, 2, 3, NaN, 6, 9, 12, 14]; ---> B = [A(2)-A(1), A(3)-A(2), A(4)-A(3). A(5)-A(4) ....] But, There is a data including the NaN values in my loop. I want to get the rate of change of sensor data. load('data_20220716.mat'); % SOG[m/s] / COG[rad] / time[sec] data = data2{5, 1}; SOG_time_data = [data(:, 1) data(:, 3)]; COG_time_data = [data(:, 2) data(:, 3)]; threshold_SOG = 0.1; threshold_COG = 0.1; for i = 2 : 1 : length(data) if isnan(SOG_time_data(i-1, 1)) || isnan(SOG_time_data(i-1, 2)) SOG_time_data(i-1, :) = nan; elseif isnan(SOG_time_data(length(data), 1)) || isnan(SOG_time_data(length(data), 2)) SOG_time_data(length(data), :) = nan; end if isnan(COG_time_data(i-1, 1)) || isnan(COG_time_data(i-1, 2)) COG_time_data(i-1, :) = nan; elseif isnan(COG_time_data(length(data), 1)) || isnan(COG_time_data(length(data), 2)) COG_time_data(length(data), :) = nan; end % SOG_time_data_index = [find(isnan(SOG_time_data(:, 1)), 1, 'last'), 1]; % ddd_SOG_time_data(:, :) = SOG_time_data(~isnan(SOG_time_data(i, :))) - SOG_time_data(~isnan(SOG_time_data(i-1, :))); if isnan(SOG_time_data(i-1, 1)) continue else d_SOG_time_data(i-1, :) = SOG_time_data(i, :) - SOG_time_data(i-1, :); end if isnan(COG_time_data(i-1, 1)) continue else d_COG_time_data(i-1, :) = COG_time_data(i, :) -COG_time_data(i-1, :); end end The fucntion diff does that for you. A=[1, 2, 3, NaN, 6, 9, 12, 14]; AnoNan=A(~isnan(A)); AnoNanDiff= diff(AnoNan); Thx Christopher Staples! But, the index of data must not be changed Are you replacing Nan with a value then? If you leave the index constant, you wont be able to do A(4)-A(3) for A=[1, 2, 3, NaN, 6, 9, 12, 14]; nan nan value nan values calculate matlab data processing
Muhammed Maral in MATLAB Answers
上次活动时间: 2022-6-6

In my project, I have 5 channels which gathers the data as in the following fields: 1-) Temperature 2-) Light 3-) Humidity 4-) Particles in Air 5-) Flammable gas 6-) Vapor and smoke 7-) Movement 8-) Sound Since ThingSpeak channels only retrieve 8 fields, I've created 5 more channels to make visualisations regarding with my data. I would like to read the data from my channel feeds and calculate AIR Quality Index. Every field in channels will have a coefficient to calculate AQI (Air Quality Index). Eg: Flammable gas data is more important than Light data in terms of AQI. As a result the fields will have following coefficients. 1-) Temperature (5) 2-) Light (5) 3-) Humidity (5) 4-) Particles in Air (15) 5-) Flammable gas (30) 6-) Vapor and smoke (30) 7-) Movement (5) 8-) Sound (5) As sum, they will add up to a score over 100 and they will be displayed in a Gauge Widget and an Environmental Status box.
Kirito23 in Discussions
上次活动时间: 2022-5-14

Hi, How can I draw windrose on matlab,I have attached sample data for you, sorry for the inconvenience Drawing Windrose on matlab matlab windrose
Anaastasia Modval in MATLAB Answers
上次活动时间: 2022-3-28

Hello, I want to subscribe to my channel from ThingSpeak, and after this to export this data to a json file. The problem is that I want this to be done automatically. Is it possible in Matlab, if yes, then how, I cannot find it in Matlab documentation? Thank you
Maryam saeed in MATLAB Answers
上次活动时间: 2022-2-23

actually i want to send data of thingspeak to matlab.the sensors data i have already uploaded on thingspeak by the aurdino IDE and use of esp32 that data i just want to send to matlab.so how to do that?
GABRIEL NICOLAU in MATLAB Answers
上次活动时间: 2021-11-20

Hi, I am trying to send ECG datd to ThingSpeak, however, at one sample per 15seconds it is rather useless when I have 650k samples. What I want to do is send a certain amount of samples before and after each R peak (I am usung find peaks to locate R-peaks after filtering the data). That way I can reduce the amount of samples sent and get more ECG signals inside the graph. Can anyone advise? PS - Patient 101 is data from MIT database. Thank you in advance! Gabriel N. Nicolau My current code is below: % clc % clear all % close all %load ( 'patient100.csv'); dat=csvread('patient100.csv'); figure; subplot(4,1,1) plot(dat) findpeaks(dat,'MinPeakHeight',0.5,'MinPeakDistance',200); title('Original') x=lowpass(dat,15,360); y=highpass(x,10,360); subplot(4,1,2) plot(x) findpeaks(x,'MinPeakHeight',0.5,'MinPeakDistance',200); title('Low-Pass') subplot(4,1,3) plot(y) findpeaks(y,'MinPeakHeight',0.3,'MinPeakDistance',200); title('High-Pass') y_diff=diff(y); y_abs = y_diff.^2; subplot(4,1,4) plot(y_abs); %for i=1: 1/length(dat)*100000: length(dat)*10000+ 1/length(dat)*100000; %t=dat(dat(i)>dat(i+1)); %end yy = y'; %%% DATA TO BE SENT TO THINGSPEAK CHANNEL a = yy; b = 0; c = 650000; x = [a]; chId = 622307; writeKey = 'XXXYYYZZZ'; tOut = 99999999; % tStamps = [datetime('now')-minutes(899):minutes(1):datetime('now')]'; for i = 1:c pause(15) b = x(i) thingSpeakWrite(chId,[b],'WriteKey',writeKey) end

关于 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.