Code covered by the BSD License  

Highlights from
UD Factorization & Kalman Filtering

UD Factorization & Kalman Filtering

by

 

15 Aug 2011 (Updated )

UD and LD factorization of nonnegative matrices and associated Kalman filter implementations.

compmex(fex,dest)
function compmex(fex,dest)
% COMPMEX: Function compiles to mex files all files with extension fex
%          in the current folder the destination folder being the current
%          one or dest (optional, relative)
%
%          compmex(fex,dest)
%
%          fex  : String with file extension like '.c'
%          dest : Destination like '..\mexexe9a' (optional,relative)
%
% L.G. van Willigenburg, W.L. de Koning, 8-6-2011
if nargin==0; fex='.c'; dest=''; dy=0;
elseif nargin==1; dest=''; dy=0; else dy=1; end

if ~isstr(fex); error(' First input must be a string'); end
if ~isstr(dest); error(' Second input must be a string'); end
if dy && ~exist(dest,'dir'); mkdir(dest); end
    
s=dir; l=length(fex);
for j=1:size(s)
  h=s(j); sh=h.name;
  if length(sh)>2 && all(sh(end-l+1:end)==fex)
    if dy
      eval(['mex ',sh, ' -outdir ',dest]);
    else
      eval(['mex ',sh]);
    end
  end
end

Contact us