Matlab gui control slider callback function

2 visualizaciones (últimos 30 días)
Daniel Kupec
Daniel Kupec el 25 de Mzo. de 2022
Comentada: Voss el 25 de Mzo. de 2022
Hi,
i want make a simple colour map display. I wanna type to the textbox and control the slider which controll axes. If I type to textbox, slider will move but the function callback did not evaluate. If I click on the slider after write number to the textbox it will do what i want. Is there any fuction to evaluate callback function of slider in callbak function of text? Thanks for any help.
This is my code in the nutshell (i dont know if it help):
%%slider
function posuvnik_Callback(hObject, eventdata, handles)
pozslid=round(get(handles.posuvnik,'Value'),0);
imagesc(h1,matice{pozslid})
%%edit text
function vyhledvzor_Callback(hObject, eventdata, handles)
vzorek=str2double(get(handles.vyhledvzor,'String'));
set(handles.posuvnik,'Value',vzorek);

Respuesta aceptada

Voss
Voss el 25 de Mzo. de 2022
%%slider
function posuvnik_Callback(hObject, eventdata, handles)
pozslid=round(get(handles.posuvnik,'Value'),0);
imagesc(h1,matice{pozslid})
%%edit text
function vyhledvzor_Callback(hObject, eventdata, handles)
vzorek=str2double(get(handles.vyhledvzor,'String'));
set(handles.posuvnik,'Value',vzorek);
% call the slider's Callback function:
posuvnik_Callback([],[],handles);
  2 comentarios
Daniel Kupec
Daniel Kupec el 25 de Mzo. de 2022
Perfect, thank you!
Voss
Voss el 25 de Mzo. de 2022
You're welcome!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Display and Exploration en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by