error in compiled version of GUI

2 次查看(过去 30 天)
Amanda
Amanda 2015-6-30
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