i need help for this, setting slider steps!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
20 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
ali hadjer
el 12 de Nov. de 2015
Editada: Image Analyst
el 13 de Nov. de 2015
Hello
I want to increment the value of my slider by one like [1:1:80]. For example :
1 2 3 4 5 6 7 8.......... until the value 80
how can I do this ?????
Can I do this with the Property Inspector????
0 comentarios
Respuesta aceptada
Image Analyst
el 12 de Nov. de 2015
Editada: Image Analyst
el 13 de Nov. de 2015
In code (your m-file) you can get the min and max and make the step one over the range:
maxSliderValue = get(handles.slider1, 'Max');
minSliderValue = get(handles.slider1, 'Min');
theRange = maxSliderValue - minSliderValue;
steps = [1/theRange, 10/theRange];
set(handles.slider1, 'SliderStep', steps);
Put this in your GUI's OpeningFcn function or whenever you change the slider's max value (which you probably don't do in your program.)
If you do it in the Property Inspector and have 1 as the min and 80 as the max, you should set the small step to 1/79 = 0.012658227848101, and the large step as some multiple of that, like 2 or 3 times as large.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Specifying Target for Graphics Output en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!