Whats the correct way to remove all links (including appdata) to a serialport

2 ビュー (過去 30 日間)
Jason
Jason 2020 年 1 月 8 日
編集済み: Jason 2020 年 1 月 8 日
I often create a serial port object, s and save it from a button callback using
s = serialport('COM2',19200)
setappdata(0,'serial',s).
I understand using the new serialport there is no need for fclose(s).
Whats the correct way to clear up both the serialport object and the appdata (from a seperate button callback that created the serialport object)
Is it
1. S1=getappdata(0,'serial')
2. delete(S1)
3. clear S1
4. rmappdata(0,'serial')
Thanks

回答 (0 件)

カテゴリ

Help Center および File ExchangeSerial and USB Communication についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by