- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I went through pages and pages of MATLAB and Fortran linking instructions,on MEX, MATLAB engine etc, I cant get a good grasp on a clear instruction to do so?
I use Intel Visual Fortran to program my code, modified on Microsoft Visual Studio, and to execute my program I open 'Fortran Build Environment for applications running on Intel(R) 64' through command: ifort fortrancodename.for
Now my question I would like to use some inbuilt functions on MATLAB (EXAMPLE [A,B]=eig(b)) - and reinterpret the solution back into fortran. Wishfully something like:
...
(Fortran Code with variable A B C D)
...
CALL-INSERT-COMMAND-INTO-MATLAB-ENGINE (eig([A B;C D])
...
(Fortran Code with variable A B C D and ANS)
...
Impossible? Possible?
Thanks
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is possible but, given the complexities of interoperating between a compiled language and an interpreted language, not to mention the difficulties associated with debugging, can you really justify this approach? For the example that you cited, after you call Matlab from Fortran Matlab may very well call a function (one that performs "eig") in an MKL DLL to calculate the eigenvalues.
It is much easier to call that function directly from your Fortran code. On the other hand, building a DLL from Fortran code for a function that can be called from Matlab is a more straightforward thing to do, and can greatly speed up Matlab routines that make numerous calls to evaluate the function.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page