Error with creating 'mobiledev' object

3 Ansichten (letzte 30 Tage)
Saitarun
Saitarun am 7 Mai 2025
Bearbeitet: Gayathri am 9 Mai 2025
Hi,
I am trying to aquire data from my mobile phone using MATLAB mobile. It works fine but, if I need to run the script again from the start, I keep getting the error "Connection to this device already exists in the workspace". I need to close MATLAB and reopen it for it to work. I am having the same problem on MATLAB mobile. I am clearing the workspace using 'clear' at the start of my script and the problem still persists. Thanks in advance for any suggestions.

Akzeptierte Antwort

Gayathri
Gayathri am 8 Mai 2025
Bearbeitet: Gayathri am 9 Mai 2025
I am not sure why you are facing this error even after clearing the "mobiledev" object from workspace. Please try to delete the object at the end of your script. This, I believe would resolve the issue.
If you are creating the "mobiledev" object as follows
m=mobiledev;
then, after using the object for your subsequent operations at the end of the script, add the below command to delete the object.
delete(m);
This will help us to destroy the object and the existing connection. Then, it will not be required to reopen MATLAB session.
Let me know if the solution works!

Weitere Antworten (0)

Kategorien

Mehr zu Sensor Data Collection finden Sie in Help Center und File Exchange

Produkte


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by