필터 지우기
필터 지우기

error in compiled version of GUI

조회 수: 2 (최근 30일)
Amanda
Amanda 2015년 6월 30일
답변: Titus Edelhofer 2015년 7월 6일
I have a large GUI project that runs from the Matlab command line. I have generated a .exe using the Matlab compiler. When I run that .exe from a DOS command window, I see the following error message.
Error using Add_Index_To_DataCentral Too many output arguments.
Error in AddDatabaseItemGUI>pb_AddItem_Call
Error in gui_mainfcn (line 95)
Error in AddDatabaseItemGUI (line 42)
Error in @(hObject,eventdata)AddDatabaseIte entdata,guidata(hObject))
Error while evaluating UIControl Callback
The function "Add_Index_To_DataCentral" has one output argument and is being called as follows from the line where the code crashes:
AssetList = Add_Index_To_DataCentral(Userid, UserName,Datasource, ... DataFreq, Topdir, Subdir, Filename, Sheetname, Datarange);
Any guidance in debugging this would be appreciated.
  댓글 수: 1
Walter Roberson
Walter Roberson 2015년 7월 3일
The line
Error in @(hObject,eventdata)AddDatabaseIte entdata,guidata(hObject))
cannot be accurate. That line would have a syntax error.

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

답변 (2개)

Nalini Vishnoi
Nalini Vishnoi 2015년 7월 2일
Hi Amanda,
It looks like your GUI is returning some data (AssetList). Please note I assume that your compiled application is named 'Add_Index_To_DataCentral.exe'. According to the following documentation page (Check under the section 'Using a MATLAB File You Plan to Deploy'):
it seems that you cannot return values from your standalone application to the user. Perhaps, this is the reason you are receiving these errors.
If it is not the case, I would first check if the GUI is working perfectly using MATLAB and then check the value of variable 'AssetList' in the function 'Add_Index_To_DataCentral' (make sure it is assigned a value before exiting the function). I hope this helps.
Thanks,
Nalini
  댓글 수: 1
Amanda
Amanda 2015년 7월 6일
No, 'Add_Index_To_DataCentral' is not the top-level function. I am not trying to return a value from a standalone application. The GUI works perfectly from the Matlab command line. But, when I compile the code and run it (AnalysisGUI.exe), it fails at a certain point with the error message shown above.

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


Titus Edelhofer
Titus Edelhofer 2015년 7월 6일
Hi Amanda,
it might happen that your code crashes within the subfunction Add_Index_To_DataCentral. In this case, the output variable is not set and you might get this error.
One way to debug this: add before the call to Add_Index_To_DataCentral a line like
save C:\temp\debugdata.mat
and run your executable. Load in MATLAB the file debugdata.mat and call
AssetList = Add_Index_To_DataCentral(Userid, UserName,Datasource, ...
DataFreq, Topdir, Subdir, Filename, Sheetname, Datarange);
This should give you an error in MATLAB that you can now trace.
Titus

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by