Hi, I need help. I have a slider for moving up and down in my axes. It works, BUT I have a button for multiply the signal (2x,3x,4x) and in these case I am setting the max and minimum value of slider, and after each push of multiply button I want to set value of slider to minimum value, but it doesn't work I have the error:
Warning: 'slider' control cannot have a 'Value' outside of 'Min'-'Max' range
Control will not be rendered until all of its parameter values are valid
set(handles.slider,'Min',handles.minimum)
set(handles.slider,'Max',handles.maximum+(handles.c_channel-1)*256)
set(handles.slider,'Value',handles.minimum)
Can anybody help me with this problem, thanks

 Accepted Answer

Jan
Jan on 22 Mar 2018
set(handles.slider, 'Value',handles.minimum, ...
'Min',handles.minimum, ...
'Max',handles.maximum+(handles.c_channel-1)*256));
Now the 'Value' is valid at each time, because all properties are changed simultaneously. Alternatively set the 'Value' at first before changing the limits.

2 Comments

Thanks, it really works, you helped me, thanks lot so, if I set this Value, max, min of slider in 3 separated rows, it doesnt work, but if I set it in one SET, does it mean that it will be change in one time?
Jan
Jan on 24 Mar 2018
Yes, it is changed at the same time. Or at least: The values are checked for validity after the command is executed.

Sign in to comment.

More Answers (0)

Categories

Find more on Embedded Coder in Help Center and File Exchange

Tags

Asked:

on 22 Mar 2018

Commented:

Jan
on 24 Mar 2018

Community Treasure Hunt

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

Start Hunting!