function y = PHI( x ) %PHI Summary of this function goes here % Detailed explanation goes here b=0.12; a=0.22; c=0.32; if x<=b y1 = 0; x1 = 0; y2 = a; x2 = b; else if x>b & x<=c y1 = a; x1 = b; y2 = a; x2 = c; else y1 = a; x1 = c; y2 = 0; x2 = 1; end end k = (y2-y1)/(x2-x1); b = -(x1*y2 - x2*y1)/(x2-x1); y = k*x + b;