how to extract slider's value
Show older comments
I'm working in MATLAB and want to obtain the value of a slider and use it as an input for calculations in another function. How can I retrieve the slider's value and pass it to another function? I attempted to use get(h,'value'), but encountered an error. How should I go about this?
Error encountered while using get:
Error using matlab.graphics.Graphics/get
Property value not found in class matlab.graphics.GraphicsPlaceholder, or is not present in all
elements of the array of class matlab.graphics.GraphicsPlaceholder.
Here's what I tried doing:
hslide(i) = uicontrol('style','slider','units','normalized');
value = get(hslide,'value');
Accepted Answer
More Answers (0)
Categories
Find more on Whos 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!