Is there an other commande in previous matlab version which remplace the commande "serialportlist" ?

Hello every one,
Is there an other commande in previous matlab version which remplace the commande "serialportlist" ?
Im using matlab 2013b, and this commande doen't exist (I think that exist in 2019

 Réponse acceptée

Previously there were instrfind() and instrfindall().

4 commentaires

Thank you soo much.
What I didn't understand is this index
What I understand is that the availble COM et is "COM3"
>> instrfindall()
Instrument Object Array
Index: Type: Status: Name:
1 serial closed Serial-COM3
2 serial closed Serial-COM3
3 serial closed Serial-COM3
4 serial closed Serial-COM3
5 serial closed Serial-COM3
6 serial closed Serial-COM3
7 serial open Serial-COM3
>> instrfind
Instrument Object Array
Index: Type: Status: Name:
1 serial closed Serial-COM3
2 serial closed Serial-COM3
3 serial closed Serial-COM3
4 serial closed Serial-COM3
5 serial closed Serial-COM3
6 serial closed Serial-COM3
7 serial open Serial-COM3
The index shows that how many times you created a serial object for 'COM3' without deleting it.
It seems that you are repeatedly creating a serial port object in your code. Whenever you create a serial object, make sure to delete it at the end
s = serial('COM3', ..)
fopen(s);
% write your code
fclose(s);
delete(s)
That will avoid the instrfind to grow uselessly.
Thank ypu soo much
Really appreciate ur answer.
Good luck

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by