Filter löschen
Filter löschen

error in compiled version of GUI

2 Ansichten (letzte 30 Tage)
Amanda
Amanda am 30 Jun. 2015
Beantwortet: Titus Edelhofer am 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 Kommentar
Walter Roberson
Walter Roberson am 3 Jul. 2015
The line
Error in @(hObject,eventdata)AddDatabaseIte entdata,guidata(hObject))
cannot be accurate. That line would have a syntax error.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Nalini Vishnoi
Nalini Vishnoi am 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 Kommentar
Amanda
Amanda am 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.

Melden Sie sich an, um zu kommentieren.


Titus Edelhofer
Titus Edelhofer am 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

Kategorien

Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by