hey ,
i have a table with two rows and a button "create"
so i enter values in table and then i want to pushbutton "create" then i want to see the graphe of it
i should use callbacks
can any help me plz

3 comentarios

Jan
Jan el 28 de Abr. de 2021
What exactly does "table" mean here? A uitable? Are you working with the AppDesigner, GUIDE or do you create the GUI by code in a figure or uifigure?
outmane charrouf
outmane charrouf el 28 de Abr. de 2021
in fact , i use edit box
for ii=1:6
hdl.nombre(ii) = uicontrol('Parent',h0,'Style','edit' ,'Units','points','horiz' ,'center', ...
'BackgroundColor' ,[1,.5,.5] ,'string',num2str(ii*5), 'FontSize',...
'Position' ,[2*x y+3.25*h ledit/2 h],'enable','inactive');
hdl.test(ii) = uicontrol('Parent',h0,'Style','edit' ,'Units','points','horiz' ,'center', ...
'BackgroundColor' ,[.8 .8 .8] ,'string', ...
'Position' ,[2*x y+3.25*h-h ledit/2 h]);
end
outmane charrouf
outmane charrouf el 10 de Mayo de 2021
it's dosen't work for me but i understand how to do it , thank you

Iniciar sesión para comentar.

 Respuesta aceptada

Jan
Jan el 28 de Abr. de 2021
Did you add the button already? Then use a callback:
% [UNTESTED CODE]
hdl.buttonH = uicontrol('Style', 'PushBotton', ...
'Callback', @ButtonCallack);
guidata(h0, hdl);
function ButtonCallback(ButtonH, EventData)
hdl = guidata(ButtonH);
nombre = str2double(get(hdl.nombre, {'String'}));
test = str2double(get(hdl.test, {'String'}));
plot(nombre, test);
end
I'm not sure, if it works this way, because I cannot test it. But the general structure should be fine. Please try it and post your code, if you have troubles with it.

Más respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 28 de Abr. de 2021

Comentada:

el 10 de Mayo de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by