Function for limit range
조회 수: 252 (최근 30일)
이전 댓글 표시
Is there any function in matlab just like 'saturation' block in simulink? Which limit a input value within a range. If it exceeds the upper value it sets to the upper value and same for lower value.
댓글 수: 0
답변 (2개)
dpb
2014년 3월 26일
Not builtin but it's simple enough to create...
function y = bound(x,bl,bu)
% return bounded value clipped between bl and bu
y=min(max(x,bl),bu);
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!