Read serial data in Matlab(in .m file of GUI, not in command window) and display on Matlab GUI

조회 수: 5 (최근 30일)
Hello all, I need to read serial data continuously and display it on Matlab GUI. I need to know which things of the .m file need to be updated because I am new to Matlab and its GUI environment. Please help...
Thanks in advance

채택된 답변

Walter Roberson
Walter Roberson 2015년 12월 5일
  댓글 수: 2
Swanand Pisat
Swanand Pisat 2015년 12월 5일
I tried with this gui but it is giving an error as -
Attempt to reference field of non-structure array.
Error in serial_GUI_noICT>connectButton_Callback (line 208) serPortn = get(handles.portList, 'Value');
Error in gui_mainfcn (line 96) feval(varargin{:});
Error in serial_GUI_noICT (line 46) gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)serial_GUI_noICT('connectButton_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
Could you please help..!
Walter Roberson
Walter Roberson 2015년 12월 5일
Which MATLAB release are you using?
Are you getting the list of ports, COM1, COM2, and so on?
There was an old release about 5 years ago where you might have to change
serPortn = get(handles.portList, 'Value');
to
serPortn = get(handles(1).portList, 'Value');
and probably other places would need changes to. The bug was corrected in the next release (and probably in a service pack as well.)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming Utilities에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by