MATLAB: Slider y lim multiply

sliderylim;

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

Best Answer

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.