How do I clear an Arduino object that is saved as an application property?

29 views (last 30 days)
How do I clear an Arduino object that is saved as an application property? I am using the "clear" command following the documentation below:
I saved an Arduino object in an application property and I used "clear" later on in order to disconnect the device. But after that I'm still getting an error when connecting the same device in another application, saying a connection to the board already exists.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 15 Sep 2021
The values of the properities are persistent as long as your applicaiton is open. You cannot clear those properties using "clear". Instead of using "clear", you can assign the property an empty value. For example. please try something like the command below:
app.a=[]
When that line is executed, the "delete" method of the Arduino object should be called.

More Answers (0)

Categories

Find more on MATLAB Support Package for Arduino Hardware in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!