error in compiled version of GUI

3 views (last 30 days)
Amanda
Amanda on 30 Jun 2015
Answered: Titus Edelhofer on 6 Jul 2015
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 Comment
Walter Roberson
Walter Roberson on 3 Jul 2015
The line
Error in @(hObject,eventdata)AddDatabaseIte entdata,guidata(hObject))
cannot be accurate. That line would have a syntax error.

Sign in to comment.

Answers (2)

Nalini Vishnoi
Nalini Vishnoi on 2 Jul 2015
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 Comment
Amanda
Amanda on 6 Jul 2015
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.

Sign in to comment.


Titus Edelhofer
Titus Edelhofer on 6 Jul 2015
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

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!