Code covered by the BSD License  

Highlights from
slatec

from slatec by Ben Barrowes
The slatec library converted into matlab functions.

[icnt,itest_v]=dcmpar(icnt,itest_v);
function [icnt,itest_v]=dcmpar(icnt,itest_v);
persistent ierpp itemp nrdp rpp ss ; 

global dcheck_1; if isempty(dcheck_1), dcheck_1=0; end;
global dcheck_3; if isempty(dcheck_3), dcheck_3=0; end;
global dcheck_4; if isempty(dcheck_4), dcheck_4=0; end;
global dcheck_5; if isempty(dcheck_5), dcheck_5=0; end;
global dcheck_8; if isempty(dcheck_8), dcheck_8=0; end;
global dcheck_9; if isempty(dcheck_9), dcheck_9=0; end;
global dcheck_7; if isempty(dcheck_7), dcheck_7=0; end;
global dcheck_6; if isempty(dcheck_6), dcheck_6=0; end;
global dcheck_2; if isempty(dcheck_2), dcheck_2=zeros(1,11); end;
if isempty(rpp), rpp=0; end;
if isempty(ss), ss=0; end;
if isempty(ierpp), ierpp=0; end;
if isempty(nrdp), nrdp=0; end;
if isempty(itemp), itemp=zeros(1,4); end;
% common :: ;
%% common /dcheck/ eps , r , rp , sveps , tol , nordp , nord , ierp ,ierr;
%% common /dcheck/ dcheck_1 , dcheck_2 , dcheck_3 , dcheck_4 , dcheck_5 , dcheck_6 , dcheck_7 , dcheck_8 ,dcheck_9;
icnt = fix(icnt + 1);
itemp(1) = 0;
itemp(2) = 0;
itemp(3) = 0;
itemp(4) = 0;
ss = dcheck_4 - dcheck_1;
nrdp = fix(dcheck_6 - dcheck_7);
rpp = dcheck_3 - dcheck_2(11);
ierpp = fix(dcheck_8 - dcheck_9);
if( abs(ss)<=dcheck_5 || icnt<=2 || icnt>=6 )
itemp(1) = 1;
end;
if( abs(nrdp)==0 )
itemp(2) = 1;
end;
if( icnt==2 )
itemp(2) = 1;
end;
if( abs(rpp)<=dcheck_5 )
itemp(3) = 1;
end;
if( abs(ierpp)==0 )
itemp(4) = 1;
end;
itest_v(icnt) = fix(itemp(1).*itemp(2).*itemp(3).*itemp(4));
end %subroutine dcmpar

Contact us at files@mathworks.com