Is it possible to change the increment value of a slider?
21 次查看(过去 30 天)
显示 更早的评论
I needed a way to change value of a constant manualy, thus I added a slider, but because of specific conditions of my project I need the value of that constant to change with fixed increment, which in my case is 0.2. I tried to look up possible solutions or methods to control the increasing rate, but didn't find anything useful. Maybe I should use matlab code instead of simulink, but I have no clue how to realise it there eather. Any help would be appreciated.
0 个评论
回答(1 个)
Matthew Moschella
2025-12-10,19:49
If you are using a slider in Simulink the easiest approach may be to round the constant value from the slider to the nearest 0.2 and then feed that number in to whatever comes after your slider currently.
Ex:
Output from Slider, x = 3.478820.
Rounded_val = (x / 0.2) * 0.2
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 General Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!