Code covered by the BSD License  

Highlights from
slatec

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

[hmax,n,nq,rmax,h,rc,rh,yh]=sdscl(hmax,n,nq,rmax,h,rc,rh,yh);
function [hmax,n,nq,rmax,h,rc,rh,yh]=sdscl(hmax,n,nq,rmax,h,rc,rh,yh);
%***BEGIN PROLOGUE  SDSCL
%***SUBSIDIARY
%***PURPOSE  Subroutine SDSCL rescales the YH array whenever the step
%            size is changed.
%***LIBRARY   SLATEC (SDRIVE)
%***TYPE      SINGLE PRECISION (SDSCL-S, DDSCL-D, CDSCL-C)
%***AUTHOR  Kahaner, D. K., (NIST)
%             National Institute of Standards and Technology
%             Gaithersburg, MD  20899
%           Sutherland, C. D., (LANL)
%             Mail Stop D466
%             Los Alamos National Laboratory
%             Los Alamos, NM  87545
%***ROUTINES CALLED  (NONE)
%***REVISION HISTORY  (YYMMDD)
%   790601  DATE WRITTEN
%   900329  Initial submission to SLATEC.
%***end PROLOGUE  SDSCL
persistent i j r1 ; 

if isempty(i), i=0; end;
if isempty(j), j=0; end;
if isempty(r1), r1=0; end;
yh_shape=size(yh);yh=reshape([yh(:).',zeros(1,ceil(numel(yh)./prod([n])).*prod([n])-numel(yh))],n,[]);
%***FIRST EXECUTABLE STATEMENT  SDSCL
if( h<1.0e0 )
rh = min([abs(h).*rh,abs(h).*rmax,hmax])./abs(h);
else;
rh = min([rh,rmax,hmax./abs(h)]);
end;
r1 = 1.0e0;
for j = 1 : nq;
r1 = r1.*rh;
for i = 1 : n;
yh(i,j+1) = yh(i,j+1).*r1;
end; i = fix(n+1);
end; j = fix(nq+1);
h = h.*rh;
rc = rc.*rh;
yh_shape=zeros(yh_shape);yh_shape(:)=yh(1:numel(yh_shape));yh=yh_shape;
end
%DECK SDSDOT

Contact us