I am using genetic algorithm optimization toolbox. i have done evrything i am also getting output and all. but i want is i want the output in particular range.

1 view (last 30 days)
For example
function t=compST(input)
x(1) = input(1);
x(2) = input(2)
x(3) = input(3)
x(4) = input(4)
x(5) = input(5)
t = 122.14-0.84.*x(1)-0.42.*x(2)+0.34.*x(3)-0.09.*x(4)+363.77.*x(5);
output = [t]
here t is compressive strenth . i want the t in range of 40-80 MPA range how can i do that

Accepted Answer

Walter Roberson
Walter Roberson on 9 Mar 2022
Edited: Walter Roberson on 10 Mar 2022
If you are using ga() then the above link shows you how to halt if the function value is within a specified value.
  4 Comments
harsh Brar
harsh Brar on 11 Mar 2022
Edited: harsh Brar on 14 Mar 2022
i wanna thank you wholeheartedly. i am absolute beginner in matlab. i have been spinning my mind around this for a while now. thank you.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by