Info

This question is closed. Reopen it to edit or answer.

Problem SETting a handle in GUI

1 view (last 30 days)
Jorge Cofino Córcoles
Jorge Cofino Córcoles on 10 Dec 2015
Closed: MATLAB Answer Bot on 20 Aug 2021
hi,
I have a very weard Problem while running a simple GUI script which I think somehow depends on the Matlab Version ... WHat I try to do is just point an object handle to a variable which contains a name and then display this name in this object in the GUI. With my Matlab Version (R2015b) works perfect but with my work colleague's Version (R2011b) we get the following error:
"Error using set
Conversion to double from struct is not possible"
and claims that the error in such a line is:
set(handles.disp_slicks_in_main,'String',slicks_display);
This happens when I push a button and try to add a data set to a database, the script executes itself perfect but does not display the name of this data set in the program-Interface because of this error.
Even more confusing ist that I have exactly the same code in the opening function of the GUI as I want the program to Display which was the last data set processed, and in there it works!!
Has anyone experienced such thing and could me help me out?
Thank you very much!!
Jorge

Answers (1)

Walter Roberson
Walter Roberson on 11 Dec 2015
It sounds as if handles.disp_slicks_in_main has somehow become a structure at that point in the code.
You should use the debugger for this.
dbstop if error
then run the code. When it stops look at class(handles.disp_slicks_in_main) : if it is a struct then it would not be convertable to a handle for use by set()
Less likely but not impossible is that class(slicks_display) has become a structure. You cannot use a structure for a 'String' parameter: you have to use a string or cell array of strings or something numeric (which would then be automatically formatted as a string.)

Community Treasure Hunt

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

Start Hunting!