MATLAB GUI Pushbutton Click Runs Callback Twice

조회 수: 3 (최근 30일)
Garrett Beebe
Garrett Beebe 2020년 5월 4일
편집: G A 2023년 6월 14일
I'm working on improving an inherited GUI to run some calculations, and it requires the user to click a pushbutton to open a browse for an input file (uigetfile()), select/import into MATLAB, and use the data within to do some number-crunching. I've made some modifications to it in GUIDE, and somehow something changed such that every pushbutton click results in its respective callback function being run twice. For example, now the user is prompted to select the input file twice; after it's successfully selected and imported, the command is run again starting with uigetfile(). The calculation is run twice, it saves the results to an external .csv file twice, etc., etc. Everything still runs fine, but every action is repeated.
I haven't made any changes to the callback functions, just the GUI/buttons. I'm not sure what's causing each function to be run twice. There do not appear to be any duplicate buttons on top of one another somehow each being clicked once to run the function twice.
I'm new to GUIDE and so I'm not sure how to effectively debug the tool. Any help is appreciated.
Thanks!
  댓글 수: 5
Garrett Beebe
Garrett Beebe 2020년 5월 4일
I've done that already, it's something within guidata/gui_mainfcn I believe.
Would you recommend switching to App Designer instead?
Rik
Rik 2020년 5월 4일
If you're going to re-write your GUI, I would highly encourage looking into this thread.

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

답변 (1개)

G A
G A 2023년 6월 14일
편집: G A 2023년 6월 14일

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by