Code covered by the BSD License  

Highlights from
matlab2fmex

image thumbnail

matlab2fmex

by

 

03 Feb 2004 (Updated )

matlab2fmex.m is a small translator which aims to convert numerical M-files to Fortran90 mex.

Editor's Notes:

This author's upload was somehow corrupted. We fixed this on March 29, 2006. At that time, we also converted it from a GZ file a ZIP file for better cross platform portability.

oldints=add_module(oldints,newints,modname)
function oldints=add_module(oldints,newints,modname)
r=char(10);
contains=findstr('contains',newints);
if isempty(findstr(modname,oldints{1}))
 rets=findstr(r,newints);
 occur=findstr(modname,newints);
 first=occur(1);
 start=rets(rets<first);
 start=start(end)+1;
 last=occur(occur<contains);
 last=last(end);
 finish=rets(rets>last);
 finish=finish(1);
 oldints{1}=[oldints{1},newints(start:finish)];
 first=occur(occur>contains);
 first=first(1);
 start=rets(rets<first);
 start=start(end)+1;
 last=occur(end);
 finish=rets(rets>last);
 finish=finish(1);
 oldints{2}=[oldints{2},newints(start:finish)];
end

Contact us