Lower bound in fmincon
Show older comments
During optimization by fmincon, I have set lower bound equal to 0. So fmincon outputs some variables with very small values like 0.00000056 which is almost equal to 0.
How can I set this value to be 0 if it goes lower than 0.01 in fmincon. Means I want precision to two places after decimal only in the output.
1 Comment
winkmal
on 17 Aug 2020
Same problem here. Any progress would be appreciated.
Answers (1)
Sai Bhargav Avula
on 23 Oct 2019
Hi,
Than setting the precision of the output of the fmincon, you can use the below given work around(as you want to set this only for the output).
n = 4; % number of desired decimal points
out= round(out*10^n)/10^n;
Hope this helps !
1 Comment
ABHISHEK BHARDWAJ
on 8 Nov 2019
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!