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

 采纳的回答

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 个评论

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?
Yes, it is changed at the same time. Or at least: The values are checked for validity after the command is executed.

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Embedded Coder 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by