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.

out=findend(linenum,s,funstr,funstrwords,keywords,keywordsbegin)
function out=findend(linenum,s,funstr,funstrwords,keywords,keywordsbegin)
left=1;right=0;
i=linenum+1;
while ((left~=right)&(i<=s))
 if length(find(strcmpi(funstrwords{i}(1),{'for';'do';'while';'if';'switch'})))==1
  left=left+1; 
 end
 if length(find(strcmpi(funstrwords{i}(1),'end')))>0, right=right+1; end
 i=i+1;
end
out=i-1;

Contact us