Code covered by the BSD License  

Highlights from
slatec

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

[cbegresult,reset]=cbeg(reset);
function [cbegresult,reset]=cbeg(reset);
cbegresult=[];
persistent i ic j mi mj ; 

;
if isempty(i), i=0; end;
if isempty(ic), ic=0; end;
if isempty(j), j=0; end;
if isempty(mi), mi=0; end;
if isempty(mj), mj=0; end;
if( reset )
mi = 891;
mj = 457;
i = 7;
j = 7;
ic = 0;
reset = false;
end;
ic = fix(ic + 1);
i = fix(i.*mi);
j = fix(j.*mj);
i = fix(i - (1000.*(fix(i./1000))));
j = fix(j - (1000.*(fix(j./1000))));
if( ic>=5 )
ic = 0;
i = fix(i.*mi);
j = fix(j.*mj);
i = fix(i - (1000.*(fix(i./1000))));
j = fix(j - (1000.*(fix(j./1000))));
end;
cbegresult = complex((i-500)./1001.0,(j-500)./1001.0);
csnil=dbstack(1); csnil=csnil(1).name(1)~='@';
if csnil&&~isempty(inputname(1)), assignin('caller','FUntemp',reset); evalin('caller',[inputname(1),'=FUntemp;']); end
end %function cbeg

Contact us