f



Does anybody know a way to convert Matlab code into Fortran and then compile Fortran mex dll file for Matlab 2006a?

Hi all,

I want to ask three questions regarding Fortran and Matlab interface. The 
two tools I am using are: Intel Visual Fortran 10.1 and Matlab 2006a.

Q1. What is the best converter to convert Matlab code into Fortran code with 
readability? My understanding is that Fortran and Matlab are both vectorized 
and they should be pretty similar and such converter should do a good job.

Q2. Is there a wizard for Intel Visual Fortran under MS Visual Studio.Net 
2003 or Visual Studio.Net 2005 to set up environments for building mex dll 
file for Matlab on Windows XP? There is such a wizard tool for VC/C++, which 
is very convenient, just create a MEX project in Visual Studio and the 
compiled the result will be a mex dll for use in Matlab. I hope there is a 
similar tool for Fortran?

Q3. Is there a tool to convert the Matlab code into Fortran with readability 
and then automatically make itself a mex dll?

Thanks a lot!



0
7/7/2007 1:49:32 AM
comp.lang.fortran 11941 articles. 2 followers. Post Follow

1 Replies
1303 Views

Similar Articles

[PageSpeed] 19

On Jul 6, 9:49 pm, "Linus Utopia" <linus_uto...@gmail.com> wrote:
> Hi all,
>
> I want to ask three questions regarding Fortran and Matlab interface. The
> two tools I am using are: Intel Visual Fortran 10.1 and Matlab 2006a.
>
> Q1. What is the best converter to convert Matlab code into Fortran code with
> readability? My understanding is that Fortran and Matlab are both vectorized
> and they should be pretty similar and such converter should do a good job.
>
> Q2. Is there a wizard for Intel Visual Fortran under MS Visual Studio.Net
> 2003 or Visual Studio.Net 2005 to set up environments for building mex dll
> file for Matlab on Windows XP? There is such a wizard tool for VC/C++, which
> is very convenient, just create a MEX project in Visual Studio and the
> compiled the result will be a mex dll for use in Matlab. I hope there is a
> similar tool for Fortran?
>
> Q3. Is there a tool to convert the Matlab code into Fortran with readability
> and then automatically make itself a mex dll?
>
> Thanks a lot!

I've not yet used the tool myself, but I plan to give Matlab2FMEX a
try soon.

Here's a link

http://aede.osu.edu/people/roberts.628/research/fmex/toolsandlinks.htm

0
abbott.bp (56)
7/7/2007 11:44:57 AM
Reply:

Similar Artilces:

watcom fortran compiler to mex fortran code in matlab
hi, I would like to know whether watcom fortran compiler can be used to run fortran mex files in matlab. Thanks Sunnam No. http://www.mathworks.com/support/solutions/data/1-19F84.html?solution=1-19F84 But we do support other FORTRAN compilers (see the above link for details). "sunnam" <sunnamhb@clarkson.edu> wrote in message news:ef25be7.-1@webx.raydaftYaTP... > hi, > I would like to know whether > watcom fortran compiler can be used to > run fortran mex files in matlab. > > Thanks > Sunnam Hi, I could figure out how to use watcom compiler to mex...

Watcom fortran compiler to mex fortran code in Matlab #2
Dear Matlab users, I am trying use to Watcom fortran compiler to run fortran-mex files in matlab. I cannot run the files as the watcopts.bat file of Matlab supports only c-mex files to run on matlab. Is there any way i can run fortran-mex files to in Matlab. I suppose some changes have to be made to watcopts.bat file like to change the compiler and linker options. Any suggestions of how to do these changes. Thankyou Himabindu ...

mex - matlab calls fortran which calls matlab which calls fortran
Dear All, I'm trying to link matlab and fortran with mex files and engine matlab, in linux OS. My general purpose is the following: 1) a matlab script A calls a mex function B based upon fortran source code 2) mex function B calls another function in matlab C within matlab engine 3) matlab routine C calls another mex file in fortran D While i'm able to do steps 2) and 3), I can't do step 1). Before to show the code, please reply to this simple question: Is it possible to build the overall process 1-3? On 8 Okt, 16:37, "Michele Catalano" <cata...@yahoo.it> wr...

Why can't Fortran-mex files be compiled on matlab V5.3 and run on matlab V6?
Hi, does anyone know why Fortran-mex files can't be compiled on matlab V5.3 and run on matlab V6? For example: if I compile the example-program (shipped with matlab) timestwo.f on matlab version 5.3 (R11) and try to run it on matlab version 6+ (R12 or R13), I get the error message: "Unable to load mex file: E:\timestwo.dll. The specified module could not be found. ??? Invalid MEX-file" Likewise if I compile it on matlab version 6.1 (R12), I get a similar error message if run on matlab version 5.3 (R11). However, if I run it on matlab version 6.5 it works OK. ...

Fortran code in matlab (mex file)
I have some algorithms implemented with fortran(alg.f) on Unix system. These fortran code with c code gateway file (alggateway.c) can be compiled as mex file on Unix system (mex alggateway.c alg.f). NOw I want recompile these code on windows system because these code had good documentations. I have some problems when I am struggling with these code. 1.Using 'mex -setup', I can only choose one compiler. If i choose fortran compiler, 'mex' wont understand *.c file, vice versa. On windows system, can I compile using command 'mex alggateway.c alg.f'. 2. I am t...

converting fortran files to matlab files
hi there all, i was wondering if it would be easy or possible to coverting fortran files into matlab files. i have some data that was created in fortran but i really need to work on that data in matlab, i m using matlab version 6.5. if anyone knows and can point me in the correct direction, i would be very grateful, Thank u for ure time Tapan Hi, You have to write mex files : Read this : <http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/ch06engi.html> J�r�me I don't understand....... You say: i was wondering if it would be easy or possible to coverting f...

Question about converting Fortran source code to Matlab file
Is it possible to convert Fortran source code to Matlab file? Thank you for your help. Alex <alex_612@yahoo.com.hk> writes: >Is it possible to convert Fortran source code to Matlab file? Some very recent items here have dealt with this. To Tim Love: Thank You very much for your reply. Would you mind to tell me which recent items have dealt with this? Is it a built-in function of Matlab? If yes, what is the name of this function?? > Tim Love wrote: > > > Alex <alex_612@yahoo.com.hk> writes: > >>Is it possible to convert Fortran source code to Matlab file...

mex file in matlab using compaq fortran compiler
I am attaching two functions which I want to translate to mex file to be used in matlab. I tried tons of time to construct a mex file(or separate mex files) to use two functions. I am wondering how to construct gateway files associated with the functions. Please let me know how to do it. Thanks guys. function nrmhermite(x,n,m,ord) implicit none integer:: ord integer:: n,m real, dimension(n,m), intent(in):: x real, dimension(n,m):: y,ny1,ny2,nny1,ny real, dimension(n,m):: nrmhermite integer::j integer:: fact if (ord==0) then y=1 fact=1 el...

mex file in matlab using compaq fortran compiler
I am attaching two functions which I want to translate to mex file to be used in matlab. I tried tons of time to construct a mex file(or separate mex files) to use two functions. I am wondering how to construct gateway files associated with the functions. Please let me know how to do it. Thanks guys. function nrmhermite(x,n,m,ord) implicit none integer:: ord integer:: n,m real, dimension(n,m), intent(in):: x real, dimension(n,m):: y,ny1,ny2,nny1,ny real, dimension(n,m):: nrmhermite integer::j integer:: fact if (ord==0) then y=1 fact=1 el...

passing structured arrays between matlab and fortran codes using mex files
Hello, I am currently trying to pass a structured array from a matlab program to a fortran program using a MEX layer in matlab. The fortran program will be called a number times since it is embedded in a loop in the matlab program. I am trying pass two lengthy structured arrays ('s' and 'par'). I am able to compile the fortan program and the mex shell in matlab, but when I execute it I recieve an error in matlab of a segmentation fault, which I think is because the structured array values are replaced by zeros when being passed from matlab into fortran. Therefore, ...

Fortran MEX: How to copy a matlab cell array into a fortran string array
Hello everyone, novice MEX programmer here, so please excuse my inexperience. I'm trying to pass a cell array of strings from matlab into a fortran mex file, and ultimately assign that data into a fortran variable full of strings that will be used in a pre-existing fortran subroutine. So, within matlab, I have something like: strings{1}='100' strings{2}='50' strings{3}='301' (Notice that the string lengths are dissimilar in general, which makes the cell array useful in this case.) I then take those strings, and pass them into a mex-function that I am wri...

Converting Fortran code to MATLAB
Hello, I have a huge fortran file, which I want to re-write in MATLAB. One option is to write the entire thing using MATLAB. Is there any way to run FORTRAN (at least some subroutines) from MATLAB? Rakib On Sat, 11 Sep 2004 12:08:10 -0400, rakib <rakib_m@yahoo.com> wrote: > Hello, > > I have a huge fortran file, which I want to re-write in MATLAB. One > option is to write the entire thing using MATLAB. > Is there any way to run FORTRAN (at least some subroutines) from > MATLAB? > > Rakib You may read this part of MATLAB documentation Matlab/External Interfa...

matlab mex file (fortran)
I want to create the mex file from external fortran file (file.for). I use compaq visual fortran 6.6a and matlab v13. Pleas help me. I have still the same problem. ------------------------------------------------------ >> mex -setup Please choose your compiler for building external interface (MEX) files: Would you like mex to locate installed compilers [y]/n? y Select a compiler: [1] Compaq Visual Fortran version 6.6 in C:\Program Files\Microsoft Visual Studio [2] Lcc C version 2.4 in C:\MATLAB6P5\sys\lcc [3] Microsoft Visual C/C++ version 6.0 in C:\Program Files\Microsoft Visual Stu...

convert fortran file to matlab
does anyone knows how to convert fortran file to matlab or matlab m-file ? This is no alternative way ... Only option you have is to do by hand/yourself ... I don't think matlab has toolbox for that... and there is NO "go to' command in matlab. On Fri, 7 May 2004 21:39:37 -0400, apphiex wrote: >does anyone knows how to convert fortran file to matlab or matlab >m-file ? Hello, for very easy m-files (that is, m-files that contain only numeric code) you can try the f2matlab program at: <https://sourceforge.net/projects/f2matlab/> Or the perl script f77toM (...

Compile Fortran Code in Matlab
Hi, I have some Fortran code that I am trying to incorporate into MATLAB routines. This code has gotos, common blocks, etc... Is there a way to compile this code into a mex file? The file I'm interested in compiling has a bunch of subfunctions (no main program). My hope is to use these subfunctions as functions in MATLAB. If this is not possible, do you have any suggestions for incorporating this code into MATLAB... or am I stuck rewriting it? Thanks! "Aaron" wrote in message <is6h9h$ope$1@newscl01ah.mathworks.com>... > Hi, > > I have some Fortran code that I ...

Converting from FORTRAN to MATLAB code
Does anyone know if there are websites that will explain the differences and similarities between FORTRAN and MATLAB? I'm trying to find out how to write some codes that are in FORTRAN using MATLAB. Build a MEX of the code instead. Best wishes, Marcus Tomlab Optimization Inc. <http://tomopt.com/tomlab/> Selene wrote: > > > Does anyone know if there are websites that will explain the > differences and similarities between FORTRAN and MATLAB? I'm trying > to find out how to write some codes that are in FORTRAN using > MATLAB. What is a MEX? Marcus M. Edvall...

fortran files compile in matlab
How to compile fortran *.f90 files in matlab. I haved tiped mex *.f90 and I tiped mex *.f90 -f df66opt.bat and i both cases a hade syntax erorrs, but i can same file compile in fortran. Can I compile it in matlab??? Did you read may answer on your previous query??? To compile fortran files in Matlab is not so simple ... You should carefully read the Matlab help for more info: - Calling C and Fortran Programs from MATLAB - Creating Fortran MEX-Files Please read first metlab help and after that ask for help. Michal "Daniel Bozic" <bozic_daniel@yahoo.c...

Does anybody know a method to make Matlab 2006a support Intel Visual Fortran 10.1?
Hi all, I downloaded and installed Intel Visual Fortran 10.1, only to find that it is not suppurted by Matlab 2006a yet. The "mex -setup" does not even recognize there is Visual Fortran 10.1 installed. Hence the option file is still the C's option file when I use "mex" to compile fortran program: -------------------- >> mex calcFFD.f90 cl : Command line warning D4024 : unrecognized source file type 'calcFFD.f90', object file assumed cl : Command line warning D4027 : source file 'calcFFD.f90' ignored cl : Command line warning D4021 : no act...

fortran code into matlab code
I am pasting the fortran code in below that I need converted into matlab code. I actually already tried to do it, but I get hundreds of errors. I am definitely not good at debugging, do not have the patience for it. Can someone give me hints/tips on how I can change it into matlab without getting all the errors? Thanks in advance; C NUMERICAL COMPUTATION OF INCOMPRESSIBLE COUETTE FLOW USING FINITE DIFFERENCE METHOD C EXPLICIT APPROACH C C MODEL EQUATION C PARTIAL(U)/PARTIAL(T)=1/RE*(PARTIAL(U) SQUARE/PARTIAL(Y) SQUARE) C DEFINE VARIABLES C VELOCITY U AT TIME T, VELOCITY UNEW AT ...

mex-file for matlab from fortran
I have a problem during the mex-file compilation. It is connected with the following error ----------------------------------------------------------- mult.f: 98: end ^ ** warning on line 98 in mult.f: file does not end in unescaped newline. Creating library _lib4917.lib and object _lib4917.exp mult.obj : error LNK2001: unresolved external symbol _MXGETL@4 mult.dll : fatal error LNK1120: 1 unresolved externals C:\MATLAB6P5\BIN\WIN32\MEX.PL: Error: Link of 'mult.dll' failed. ??? Error using ==> mex Unable to complete successfully --------------------------...

how to convert this line of Matlab code into Fortran?
Hi all, In my Matlab code, I have the following function call: y=maple('binomial', h, n+1); where "h" is in fact a negative irrational number(that's why we use maple to help), "n" is a positive integer. Now how to rewrite this in Fortran? thanks! On 8 Jul, 06:08, "Linus Utopia" <linus_uto...@gmail.com> wrote: > Hi all, > > In my Matlab code, I have the following function call: > > y=maple('binomial', h, n+1); > > where "h" is in fact a negative irrational number(that's why we use maple to > ...

Converting fortran files into matlab 6
hi there, i have a dynamic model which was written in fortran language, i need to convert it into matlab files so that i can work on it on matlab, does anyone know how to do that. your input on the question will be greatly appreciated. ...

Using fortran in Matlab with MEX-files
Hi I'm using Fortran to speed up some of my matlab code as I need to do some looping (and it can't be eliminated with vectorization). I've written a mex file in Fortran (with Compaq Visual Fortran) and it appears to show 0 errors I've then compiled that file in MATLAB with mex filename.f and it seems to work. When I go to run the .m file containing the link to the 'new function', a segmentation violation occurs. I'm stuck as to where this error occurs and how I can eliminate it. Can anyone help? In article <eefbe2e.-1@webx.raydaftYaTP>, Michael Hammond w...

Intel Fortran and matlab mex files
Hi! I have problems making the Intel Visual Fortran compiler work with Matlab. The following has been installed on my computer: - Matlab (R2006b) - Visual Studio .NET 2003 - Intel Visual Fortran v9.0 and I have run the mex setup in Matlab: mex -setup and chosen the supported Intel Visual Fortran v.9.0 compiler which Matlab detected itself. When trying to compile the Fortran template source files included with Matlab I get the following error: LINK : error LNK2001: unresolved external symbol MEXFUNCTION C:\DOCUME~1\sct\LOCALS~1\Temp\mex_C49481D9-C545-4A5F-81A0-3437...

Web resources about - Does anybody know a way to convert Matlab code into Fortran and then compile Fortran mex dll file for Matlab 2006a? - comp.lang.fortran

Apple formally appeals judge's iPhone unlocking order
Just in case its motion to vacate wasn't enough, Apple late Tuesday filed an appeal of a California judge's order requiring it to help the FBI ...

Watch Bruce Springsteen dance with a 91-year-old grandma
Good old Bruce Springsteen pulled a new dance partner onstage at his Saint Paul, Minnesota, show: 91-year-old Jeanne Heintz. The 66-year-old ...

Facebook Reaches 3 Million Advertisers, Launches Your Business Story Video Tool
More than 3 million businesses are now advertising on Facebook–up from 2.5 million in September 2015 and 2 million last February –and more than ...

Brazil judge orders release of Facebook executive
Agence France-Presse : Brazil judge orders release of Facebook executive — Sao Paulo (AFP) - A Brazilian judge ordered the release Wednesday ...

Kanye West's The Life of Pablo is streaming on Pornhub
Here's a tip if you want to listen to Kanye's The Life of Pablo but your free trial on Tidal has expired: Go to Pornhub. The album is streaming ...

Wildcats, everywhere: 'High School Musical 4' is happening
Wildcats, it's time to get your heads back in the game. Disney Channel announced Tuesday that a fourth High School Musical film is in the works. ...

Tom Sturridge, Maisie Williams & More Join Haifaa Al-Mansour’s ‘A Storm In The Stars’
A Storm In The Stars is the English-language helming debut of Wadjda ‘s Haifaa Al-Mansour which began shooting late last month. The love story ...

UN adopts toughest-ever North Korea sanctions
The UN Security Council unanimously adopted on Wednesday the toughest sanctions ever imposed on North Korea in response to its fourth nuclear ...

Grand Jury Indicts Father on 1st-Degree Murder Charge
A grand jury has indicted a Florida man on a 1st-degree murder charge in the 2015 death of his 7-week-old son

The Final Thoughts of Osama Bin Laden: Declassified Documents Revealed
TheBlaze.com The Final Thoughts of Osama Bin Laden: Declassified Documents Revealed The Jewish Press Newly released documents from Osama Bin ...

Resources last updated: 3/2/2016 4:56:21 PM