% this version of cumulative chi is for inverting %to find x for a given probability. % for this reason p has to be defined in the calling program function cumchi=cumchi(x); global p; cumchi=quad('chisq',0,x)-p; end;