%Belonging to the max_min script. Finds the max and min values of the
%evaluate variable
function [maxim minim valve1]=max_min_func(input)
    run(num2str(input));
    PX=[P1f, P2f, P3f];
   
 
    for j=1:3
    maxim(j)=max((t>100).*PX(:,j)); %evaluted after 100 sec
    
    minim_temp=(t>100).*PX(:,j); 
    minim_temp(~minim_temp)=inf;
    minim(j)=min(minim_temp);
    end
    
    valve1=valve(end);
end