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

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 12 月 8 日
Previously there were instrfind() and instrfindall().

4 件のコメント

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.
islam dib
islam dib 2020 年 12 月 10 日
Thank ypu soo much
Really appreciate ur answer.
Good luck
Ameer Hamza
Ameer Hamza 2020 年 12 月 10 日
I am glad to be of help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2020 年 12 月 8 日

コメント済み:

2020 年 12 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by