error in compiled version of GUI

3 visualizaciones (últimos 30 días)
Amanda
Amanda el 30 de Jun. de 2015
Respondida: Titus Edelhofer el 6 de Jul. de 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 comentario
Walter Roberson
Walter Roberson el 3 de Jul. de 2015
The line
Error in @(hObject,eventdata)AddDatabaseIte entdata,guidata(hObject))
cannot be accurate. That line would have a syntax error.

Iniciar sesión para comentar.

Respuestas (2)

Nalini Vishnoi
Nalini Vishnoi el 2 de Jul. de 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 comentario
Amanda
Amanda el 6 de Jul. de 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.

Iniciar sesión para comentar.


Titus Edelhofer
Titus Edelhofer el 6 de Jul. de 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

Categorías

Más información sobre MATLAB Compiler en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by