How to limit an input within a specific range?
4 次查看(过去 30 天)
显示 更早的评论
In the code below, I am willing to set min and max value for u so if it exceeded that limit it will either return the max or the min value.
K1=1/.1;
K2=10;
E=E+(Cos-Com)*dt;
u=(-V/Com)*((YOSan-YOSen)*(-Yx*(qM-(Com*Sm*qsMax)/((Com+Ko)*(Sm*Sm/Ki+Sm+Ks))))*(0.96/0.375)+YOSen*((Com*Sm*qsMax)/((Com+Ko)*(Sm*Sm/Ki+Sm+Ks)))-kLa*(Costar-Com)+ K1*(Cos-Com) + K2*E);
uplot(k,:)=u; % this is just for the visualisation ate the end
u = min(......
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Verification, Validation, and Test 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!