Add Available serial port into pop up menu
2 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I wish to get a list of available serial port in my computer and display them in the pop up menu. code:
a=instrfind('Type','Serial');
for i=1:length(a)
text{i}=a(i);
end
set(handles.popup1,'String',text);
guidata(hObject,handles);
but, there's nothing shown in the pop up menu. May i know which part i did wrongly? Thanks
1 件のコメント
Walter Roberson
2012 年 6 月 17 日
Please do not name a variable "text" as that conflicts with the important graphic function "text".
回答 (1 件)
Walter Roberson
2012 年 6 月 17 日
a = instrfind('Type','Serial');
for i = 1:length(a)
portnames{i} = get(a(i), 'Port')
end
set(handles.popup1, 'String', portnames);
3 件のコメント
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!