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.

funlist=makesize2(wantsizes,funlist,len,r,typestr)
function funlist=makesize2(wantsizes,funlist,len,r,typestr)
if wantsizes
 for ii=1:len
  if ((typestr(ii)=='r')|(typestr(ii)=='c')|(typestr(ii)=='i')|(typestr(ii)=='l'))
   funlist=[funlist,'        in_',num2str(ii),'_m=size(in_',num2str(ii),',dim=1); in_',num2str(ii),'_n=size(in_',num2str(ii),',dim=2)',r];
  elseif ((typestr(ii)=='w')|(typestr(ii)=='x')|(typestr(ii)=='y')|(typestr(ii)=='z'))
   funlist=[funlist,'        in_',num2str(ii),'_m=1; in_',num2str(ii),'_n=size(in_',num2str(ii),')',r];  
  else
   funlist=[funlist,'        in_',num2str(ii),'_m=1; in_',num2str(ii),'_n=1',r];
  end
 end
end

Contact us