Llamar a una función cada ver que se modifique el Value de un slider
5 views (last 30 days)
Show older comments
Buenas tardes.
Mi problema es que necesito que se llame a una función cada ver que el usuario varie el valor de un slider. Lo he provado de poner la llamada a la función en el call_back, Button_Down y el Key_pres, y en ninguno funciona.
¿Alguien sabe como se puede hacer?
Un saludo
2 Comments
Image Analyst
on 18 Feb 2013
Edited: Image Analyst
on 18 Feb 2013
http://translate.google.com/?hl=en&tab=wT Some question about a slider, so please show your source code, and screenshot if it would be helpful to illustrate your issue to us.
Walter Roberson
on 18 Feb 2013
Google translation:
Good afternoon.
My problem is that I need to call a function every view the user to vary the value of a slider. I've proven to put the function call in the call_back, Button_Down and Key_pres, and none works.
Does anyone know how to do?
greetings
Answers (1)
Image Analyst
on 18 Feb 2013
Have a text label right above the slider. In the regular callback (for slider1_Callback or something like that), have this
% Get the slider value. The slider tag is slider1.
sliderValue = get(handles.slider1, 'Value');
% Make a string with the value in it.
caption = sprintf('The slider value = %.3f', sliderValue);
% Send the string to the static text control.
% The tag for the static text label above the slider is sliderText.
set(handles.sliderText, 'String', caption);
0 Comments
See Also
Categories
Find more on String Parsing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!