メインコンテンツ

結果:



20 minutes makes a difference

I struggled to learn MATLAB at first. A colleague at my university gave me about 20 minutes of his time to show me some basic features, how to reference the documentation, and how to debug code. That was enough for me to start using MATLAB independently. After a few semesters of developing analyses and visualizations, I started answering questions in the forum when I had time. I became addicted to volunteering and learning from the breadth of analytical problems the forum exposed me to.



Have you ever solved a problem using a MathWorks product?

If your answer is YES, you may be the right person to help someone looking for guidance to solve a similar problem. Some answers in the MATLAB Central community forum maintain 1000s of views per month and some files on the File Exchange have 1000s of downloads. Volunteering a moment of your time to answer a question or to share content to the File Exchange may benefit countless individuals in the near and distant future and you will likely learn a lot by contributing too!

  • 3616 questions were asked last month in the forum and in that time, 747 volunteers answered at least one question!
  • 62% of those volunteers were first-time contributors!
  • 335 volunteer contributors shared content in the File Exchange last month!
  • 1: the number of contributions it takes to make a difference.

This week is National Volunteer Week in the USA (April 17-23). Challenge yourself and your colleagues by committing to help a stranger break barriers in their path to learning MATLAB.



How to volunteer and contribute to the MATLAB Central Community

Here are two easy ways to accept the volunteer challenge.

Contribute to the MATLAB Answers Forum

  1. Go to the MATLAB Answers repository. This page shows all unanswered questions starting with the most recent question. Use the filters on the left to see answered questions or questions belonging to a specific category. Alternatively, search for questions using keywords in the search field or visit the landing page.
  2. Open a few questions that interest you based on the question titles and tags.
  3. Decide how you'd like to contribute. Sometimes a question needs refinement or requires a bit of work to address. Decide whether to leave a comment that guides the user in the right direction, answer the question, or skip to the next question. The decision tree below is how some experienced contributors approach these decisions.

Pro tips

  • Newer questions have more traffic and are often answered within an hour or minutes.
  • Multiple answers often add valuable alternative perspectives and solutions.
  • Sometimes answers aren't accepted or the asker disappears. Be not discouraged. Your answer holds much value.



Contribute to the File Exchange

  1. Choose a function, script, demo, or toolbox you created that may be helpful to the community.
  2. Go to the MathWorks File Exchange. Search for submissions that are similar to your idea and decide whether your idea adds value.
  3. Prepare your code for open-source sharing. The best submissions include brief documentation that explains the purpose of the code, inputs, expected outputs and limitations.
  4. Use the "Publish your code" button from the link above. This will guide you through the submission process.



Make a difference

No matter what level you are at as a MATLAB developer, you have skills that others around you could benefit from learning. Take the challenge and become a giant.

Let us know about your experience with MATLAB Central volunteers or your experience becoming a MATLAB Central volunteer in the comments below!

Alex Stoica
Alex Stoica
最後のアクティビティ: 2022 年 4 月 18 日

Hello guys, I'm a new Thingspeak user and I don't know how can I filter a numbers from a data string using the ThingHTTP application or MPLAB Analysis. The data string it's come from a power meter and the structure is like below: {"data":{"values":[[249.000,0.370, 30.000,0.532,0.001],[246.400,0.290, 6.000,0.088,0.000][240.900,0.640, 77.000,0.526,0.000]],"localTime":"2022/3/25 1:30:38","gmtTime":"2022/3/24 23:30:38"},"successful":true,"message":null}.

So, I need to extract only the numbers that represents the instant power on each phase (bolded numbers). When I tried to use the MPLAB Analysis - get data from a webpage, but the filter it return "2022" number.

I also try to use the ThingHTTP, I managed to display the entire data string (like above), but I can't filter them. If I select the numbers that interest me and right click on this to inspect the element, I saw that the entire string is stored as single element.

Can you offer me any suggestion to filter only one number an dafter that to make a graph in Thingspeak?

Thanks a lot in advance!

Is it possible to get a "Handshake" back from the server to acknowledge receipt of a data packet ? I want to drive Red/Green LED - Red for Sent followed by Green if receipt is confirmed. I have an ESP32 project sending data without problems, unknown to me the internet connection had been lost, but I had no indication anything was wrong.

Paolo Fiore
Paolo Fiore
最後のアクティビティ: 2022 年 4 月 15 日

Hi everyone, is there any problem with the Thingspeak MQTT broker right now? This is the error message I keep seeing in the terminal window using node-RED.

[info] [mqtt-broker:ThingSpeak MQTT Broker] Connection failed to broker: mqtt://mqtt.thingspeak.com:1883

And on the gui, the mqtt-in node is perpetually in "connecting.." state.

I tested some weeks ago and it was working fine. Now it doesn't work. I have asked my students to make a simple project using the MQTT protocol and now they can't proceed, I don't understand why.

Donald Duck
Donald Duck
最後のアクティビティ: 2022 年 4 月 16 日

I've had a Thingspeak channel since 2017. It's updated by a RPi running Raspbian Lite (the Raspberry Pi version of Debian Linux). The "Lite" means there's not much GUI stuff in there, and the RPi is run "headless" using SSH. To update my channel I use the linux utility curl to send http GET commands. curl is run at intervals from a bash script which loops indefinitely.

This has worked fine for nearly 5 years until suddenly between 14:00 and 14:20 UTC on 13/4/22 (UK format) it stopped working, and I started getting HTTP error 400 responses. I haven't changed anything; I haven't updated the RPi OS for over a year, and the timestamp the bash script file is 2020.

Status is enabled on the channel, and a little trial and error showed that the problem was caused by including a status update string which contained a space character. So the workaround is simple, just amend the status string to not have a space character, and all is well again.

I can still send status updates with a string including a space character directly from a web browser, so what has happened to break curl after all this time?

MATLAB EXPO is open to everyone:
Industry Tracks:
  • AI in Engineering
  • Modeling and Simulation
  • Implementation and DevOps
  • Algorithm Development and Deployment
  • 5G, Wireless, and Radar
  • Autonomous Systems and Robotics
  • Electrification, Motor Control, and Power Systems
  • Preparing Future Engineers
Special Event: Save the Earth: Accelerate Climate Science and Electrify Everything
The climate crisis is here. Engineers and scientists are engaged to help. Engineers innovate rapidly to decarbonize energy production, electrify everything, and design sustainable products. Scientists accelerate their research to inform climate adaptation and enhance understanding through advances in cloud computing and artificial intelligence. And educators train the next generation to take these advances even further. In this talk by Dr. Tanya Morton, you will learn how scientists and engineers use MATLAB® and Simulink® to tackle this great challenge—to save the earth and build a clean, electrified future!

Hello, today my Python script is giving error messages "There was an error while publishing the data". It is an existing script that runs for a couple of years already. My local network, Wifi, ... is OK. Rebooting Pi does not help. Is there maybe an issue on the Thingspeak servers ? Kind regards, Patrick (Belgium).

Yo Apps
Yo Apps
最後のアクティビティ: 2022 年 4 月 18 日

Hi, Its my day 1... and just thought i should confirm something for sake of clarity. I found this table on the site...

But I want to know does Number of Messages include Reads & Writes... or only Writes because the other parameter is Message update interval limit ... and usually the word update is a part of the operation where there is a WRITE being committed. And thats what confused me...

So is that interval only for updating data... or is it even if you are reading data?

Thanks

Jan Maly
Jan Maly
最後のアクティビティ: 2022 年 4 月 14 日

Hello,

can someone please help me to understand, how average works? I send data from temperature sensor to Thingspeak roughly every 5 min(DIFF column in seconds). If i dont use average, i can see temperature in more less 5min slots around 20 degrees. See DATUM and TEPLOTA field on first image(Vlhkost is humidity).

I supposed, if i use parameter average=60, it will calculate average temperature in time slot 60min and extract it. But if you check second image with same data, only parameter average=60 added, results are crazy. I can see rows per hour, but values are crazy, around 7 degrees. I really dont understand what system calculate. I get exactly same result on thingspeak page in channel setup, so problem is not with my page.

Thingspeak screenshots 1day without average

1day with average 60

settings i changed

Dears Good day. I am new in IoT and I need help I am looking for a code that I can run to transmit real-time data from Revolution Pi based on Raspberry Pi to Thingspeak. I have code I used before to transmit data from Revolution Pi based on Raspberry Pi to Wolkabout ( cloud platform). Nevertheless, due to license issues. I had to change to Thingspeak. Can you please help me to adjust the code so that I can use it with Thingspeak instead of Wolkabout. Here is the code .............Code start...............

import os
import random
import sys
import time
from urllib.request import urlopen
import wolk 
import revpimodio2
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
from pymodbus.register_read_message import ReadInputRegistersResponse
  1. Sensors Keys device = wolk.Device(key="KDD", password="FDV7F12TSW")

wolk_device = wolk.WolkConnect(device, host="54.72.159.61", port=8883, ca_cert="ca_local_wolkabout.crt") # Establish a connection to the WolkAbout IoT Platform print("Connecting to WolkAbout IoT Platform") wolk_device.connect() rpi = revpimodio2.RevPiModIO(autorefresh=True)

  1. For Modbus RTU Connection #client = ModbusClient(method = 'rtu', port='/dev/ttyRS485', stopbits=1, bytesize=8, parity='E',baudrate=19200,timeout=1,strict=False) #connection = client.connect() #print(connection)

def main(): """Connect to WolkAbout IoT Platform and send a random sensor reading."""

    publish_period_seconds = 5
    # LS1 Level sensor 1 LS2 Level sensor 2 VS1 Velocity sensor 1 VS2 Velocity sensor 2
    while True:
        try:
            #first set of the sensors
            LS1 = rpi.io.InputValue_1.value*0.059056-205.825
            LS2 = rpi.io.InputValue_2.value*0.059056-205.825
            VS1 = rpi.io.InputValue_3.value*0.0025-10
            VS2 = rpi.io.InputValue_4.value*0.0025-10
            #sensors from RTU1
            #Temp1= (client.read_input_registers(58, 1, unit=1))
            #Temp2 = Temp1.registers
            #Temp = float(Temp2[0])/100
            Temp1 = rpi.io.Temperature.value/100
            Temp2 = rpi.io.Temperature2.value/100
            #mu1= (client.read_input_registers(66, 1, unit=1))
            #mu2 = mu1.registers
            #mu = float(mu2[0])/100
            mu1 = rpi.io.Viscosity.value/100
            mu2 = rpi.io.Viscosity2.value/100
            #rho1= (client.read_input_registers(74, 1, unit=1))
            #rho2 = rho1.registers
            #rho = float(rho2[0])/100
            rho1 = rpi.io.Density.value/100
            rho2 = rpi.io.Density2.value/100
            #publshing data
            #wolk_device.add_sensor_readings({"LS1": LS1,"LS2": LS2,"VS1": VS1,"VS2": VS2,"Temp1": Temp1,"rho1": rho1,"mu1": mu1,"Temp2": Temp2,"rho2": rho2,"mu2": mu2})
            print('Publishing "Level Sensor 1": ' + str(LS1))
            print('Publishing "Level Sensor 2": ' + str(LS2))
            print('Publishing "Velocity Sensor 1": ' + str(VS1))
            print('Publishing "Velocity Sensor 2": ' + str(VS2))
            print('Publishing "Temperature_RTU1": ' + str(Temp1))
            print('Publishing "Viscosity_RTU1": ' + str(mu1))
            print('Publishing "Density_RTU1": ' + str(rho1))
            print('Publishing "Temperature_RTU2": ' + str(Temp2))
            print('Publishing "Viscosity_RTU2": ' + str(mu2))
            print('Publishing "Density_RTU2": ' + str(rho2))
            #wolk_device.publish()
            time.sleep(publish_period_seconds)
        except KeyboardInterrupt:
            print("\tReceived KeyboardInterrupt. Exiting script")
            wolk_device.disconnect()
            sys.exit()

if _name_ == "__main__": main() ...............Code End................... Hope that you can help me. I have a fee account in Thingspeak, only 1 channel with 8 fields which is enough for my current project for time being. Wish you a nice day

Michael Hasselbeck
Michael Hasselbeck
最後のアクティビティ: 2022 年 12 月 7 日

I have developed an acoustic sensor that can pick up water leaks at a substantial separation distance. The leaks must originate from pressurized plumbing, which causes the emission of broadband acoustics. The sensor is on a small PCB that communicates with the host controller via I2C. I have connected to an ESP8266 WiFi module and uploaded data to ThingSpeak. The entire project is open-source; you can view the documentation, design files, and firmware on github:

https://github.com/microphonon/acoustic-leak-detector

Let me know if you have any questions. Mike

Don't waste time searching-just ask
6%
A few minutes or 1-2 searches
21%
A few hours, most Qs aren't unique
40%
Days-asking for help is last resort
14%
Infinite. I'll never ask a question
20%
23801 票
Spacerlabs Team
Spacerlabs Team
最後のアクティビティ: 2022 年 4 月 14 日

Hi, I am a newcomer to ThingSpeak, and have created a channel for my soil-moisture sensor. I have checked "show status" of my channel. 'Channel Status Updates' widget appears, but no data are displayed. It is not responding. The widget is always blank despite new sensor data every hour. I would like to display default status messages. Why doesn't it work and what should I do ? I have searched all documentation but find no help there. br SpacerLabs Team

I am trying to extract the value of a couple of variables from a very basic web page. Although I can see the variable's values changing when I Inspect the page in Chrome Browser and Xcopy, I only get the variable name, not its value, when I select the option to "send your ThingHTTP request and view the response using the following URL:" Can anybody point this rookie in the right direction please?

None
30%
Less than what tasks demand
40%
Sufficient for what tasks demand
20%
More than sufficient
5%
Too much
4%
384 票
Learn new skill (e.g.Deep Learning)
68%
Complete a Cody Challenge Group
3%
Upload a new File Exchange program
3%
Take online/in-person MATLAB course
11%
Answer an "Answers" forum question
15%
1220 票
Dhuwaragish Ravichandrakumar
Dhuwaragish Ravichandrakumar
最後のアクティビティ: 2022 年 4 月 8 日

Hi all, I currently have a forecasting of a variable based on the data that I collected. But is there a way to calculate what is the accuracy for the forecast? Thanks.

Hans Scharler
Hans Scharler
最後のアクティビティ: 2022 年 4 月 6 日

Hi everyone. I updated my IoT Debugger project on GitHub. You can use the debugger to view channel data from ThingSpeak.

Adam Danz
Adam Danz
最後のアクティビティ: 2022 年 4 月 5 日

.

MATLAB R2022a provides app developers more control over user navigation through app components using the keyboard's Tab key.

Part 1. The new focus function: programmatically set keyboard focus to a UI component

Part 2. Modify focus order of components

Today we'll review Part 2. See yesterday's Community Highlight for Part 1.

-------------------------------------------------------------------------------------------------

Well-designed apps have an obvious flow through interactive fields and, as we learned yesterday, using the Tab key to move the focus to the next UI component is faster and more efficient than using a mouse. Here we'll learn how to read and set the tab order of UI components in an app.

Understanding tab and stacking order

By default, tab order in MATLAB apps is controlled by the stacking order in the Component Browser. Initially, the stacking order within the component browswer is based on the sequence in which the objects were added to the container object within the app. MATLAB R2020b gave us control to edit the stacking order by selecting a component and using either the Reorder tool from the Canvas toolstrip or by right-clicking the component and selecting Reorder from the context menu [1]. Tab order flows from bottom to top through the Component Browswer hierarchy for objects that are focusable. Sending a component backward within the stack sets its tab order to earlier relative to other components.

Setting tab focus order in R2022a

Three additional tab order features were added in MATLAB R2022a that make it easier to control app navigation with the Tab key.

1. Sort and Filter by Tab Order : Instead of using the Reorder tool which lists components in reverse tab-order and includes components that are not focusable, filter the list by focusable components and sort them by tab-order using the View dropdown menu within the Component Browser (label 1 in image below). From here, you can drag and drop components to set their tab (and stacking) order.

2. Auto Tab Order : To automatically sort focusable components within your app so that the tab order is from left-to-right and then top-to-bottom, in App Designer, from Design View, select the Canvas tab > Tab Order button > Apply Auto Tab Order (label 2 in image below). Alternatively, you can apply auto tab order to components within a container such as a uipanel or uitab by right-clicking on the container within the Component Browser and selecting Apply Auto Tab Order.

3. Visualize Tab Order : You no longer have to read and interpret the handle names in the component browser to understand the current tab order of UI components. Instead, view an animation of tab order within App Designer. From Design View, select the Canvas tab > Tab Order button > Visualize Tab Order (label 3 in image below).

.

Contextual focus control: the power of combining focus() with setting tab order

Yesterday's Community Highlight showed how to programmatically set UI component focus using the focus(c) function. This, combined with control of tab order, allows app developers to implement contextual focus control. For example, when a radio button is selected in the GIF below, the corresponding UI Tab is selected programmatically and the keyboard focus is set to the first component within the UI Tab thus allowing the user to smoothly continue keyboard navigation. This is achieved by a callback function that responds to changes in the Button Group that sets the SelectedTab property of the TabGroup and uses the new focus() function. For details, see the attached focusAndTabOrderDemo.mlapp.

-------------------------------------------------------------------------------------------------

Stay tuned

Follow Community Highlights to get notifications for new content.

Let us know what interests you in the new MATLAB R2022a release in the comment section below.

See also

Footnotes

[1] R202b release notes: change the stacking order of UI components

This Community Highlight is attached as a live script.