Llamar a una función cada ver que se modifique el Value de un slider

4 views (last 30 days)
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
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
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

Sign in to comment.

Answers (1)

Image Analyst
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);

Tags

Community Treasure Hunt

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

Start Hunting!