Error with set(handles.text1,'String','test') at GUI
Mostrar comentarios más antiguos
Hello,
I'm working on some GUIs and I use the set(handles.anything,...) command often. Today when I opened Matlab and tried to work on the project, I get errors evertime, a line occurs, using the syntax 'handles.anything'. The notion is: "Attempt to reference field of non-structure array." The error is not limited to a certain command. I reduced the problem to a blank gui, inserting a text field and a button. By clicking the button, one command works fine (this uses 'gcf'), the other one fails:
set(handles.text1,'String','anything');
Thank you for your help.
Ferdinand
6 comentarios
Friedrich
el 18 de Abr. de 2012
Can you post the gui code from your example?
Ferdinand Trommsdorff
el 18 de Abr. de 2012
Editada: Walter Roberson
el 7 de Dic. de 2018
Jakob Sørensen
el 18 de Abr. de 2012
Have you written it inside the initialization code?
Because if you look at the comment in the beginning of that section, that could be the problem.
Ferdinand Trommsdorff
el 18 de Abr. de 2012
Mohamed Samir
el 7 de Dic. de 2018
Error in ==> ImageCompression1>pushbutton1_Callback at 91
set(handles.text7,'string',Size);
Walter Roberson
el 7 de Dic. de 2018
There would have been more to the error message than that?
Respuestas (1)
Carlos Andres Ramiez Irene
el 25 de Nov. de 2017
Editada: Walter Roberson
el 25 de Nov. de 2017
% ---Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved -to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
syms x;
ingreso=char(inputdlg('ingrese funcion'));
f=inline(ingreso);
n=str2double(inputdlg('ingrese numero de expresiones para la serie'));
ev=taylor(f(x),'order',n)
fun=string(ev);
set(handles.text1,'string',fun);
% me sale este error Not enough input arguments.
%Error in pushbutton1_Callback (line 12)
%set(handles.text1,'string',fun);
Categorías
Más información sobre Time Series Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!