How to extract a slider value?

3 visualizaciones (últimos 30 días)
Darío Imbernón Clavero
Darío Imbernón Clavero el 20 de Abr. de 2021
Editada: Adam Danz el 23 de Abr. de 2021
%Slider
fig = uifigure('Position',[100 100 350 275]);
pnl1 = uipanel(fig);
sld1 = uislider(pnl1,'Position',[100 40 120 3],... 'ValueChangingFcn',@(sld,event1) slider1(event1));
sld1.Limits = [-100 100];
sld2 = uislider(pnl1,'Position',[100 100 120 3],... 'ValueChangingFcn',@(sld,event2) slider2(event2));
sld2.Limits = [-100 100];
sld3 = uislider(pnl1,'Position',[100 180 120 3],... 'ValueChangingFcn',@(sld,event3) slider3(event3));
sld3.Limits = [-100 100];
I'm trying to make a program to extract the power of my engine from the sliders I declared(each one corresponds to one engine). So I need to extract the value of each slider when i dragg it as an integer variable, if anyone can help it will be great.
Thanks!

Respuestas (1)

Adam Danz
Adam Danz el 20 de Abr. de 2021
Editada: Adam Danz el 20 de Abr. de 2021
See the value property in the slider documentation.
  3 comentarios
Darío Imbernón Clavero
Darío Imbernón Clavero el 21 de Abr. de 2021
I put this for to read the values of the slider as you said, but it sends me this error. I dont find any information about it.
Adam Danz
Adam Danz el 21 de Abr. de 2021
Editada: Adam Danz el 23 de Abr. de 2021
The first line of the error message tells you what the problem is.
slider3 is not defined.
You probably mean app.slider3 assuming that's the handle to your slider.

Iniciar sesión para comentar.

Categorías

Más información sobre Language Fundamentals en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by