Code covered by the BSD License  

Highlights from
f2matlab

f2matlab

by

 

16 Jun 2004 (Updated )

Converts basic fortran90 source code to MATLAB source code.

TESTING_ex.m
clear all;r=char(10);

functions={'dgauleg','H1f','lpmns','lqmns','mcpbdn','as245','slatec_test2','zztest','femprb','toms757_prb','quadrule_prb','stroud_prb'};
functionCalls={'[x1,x2,x,w,n]=dgauleg(0,1,[],[],10)',...
               '',...
               '[m,n,x,pm,pd]=lpmns(0,3,.5)',...
               '[m,n,x,qm,qd]=lqmns(0,3,.5)',...
               'mcpbdn',...
               'as245(10)',...
               'slatec_test2'...
               'zztest'...
               'femprb'...
               'toms757_prb'...
               'quadrule_prb'...
               'stroud_prb'...
              };

ttt1=cputime;
for i=1:length(functions)
 disp([char(10),char(10),'%%%%% ',functions{i},'.f90 --> ',...
       functions{i},'.m %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'])
 eval(['f2matlab(''',functions{i},'.f90'');']);
 eval(functionCalls{i});
 disp(['%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'])
end
disp(['converted and ran all ',num2str(length(functions)),' functions in ',num2str(cputime-ttt1),' seconds'])

Contact us