<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic The example in the link that in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-Matlab-interface/m-p/1092212#M124659</link>
    <description>&lt;P&gt;The example in the link that you provided, and several examples in the Matlab "extern" subdirectory on your computer, can be consulted.&lt;/P&gt;

&lt;P&gt;You have to modify your Fortran source code such that the entry point is a subroutine called mexFunction, with input and output arguments in the way specified in the Matlab documentation.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2016 02:48:05 GMT</pubDate>
    <dc:creator>mecej4</dc:creator>
    <dc:date>2016-08-11T02:48:05Z</dc:date>
    <item>
      <title>Fortran-Matlab interface</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-Matlab-interface/m-p/1092207#M124654</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;I am very new to Fortran. I am building some Fortran codes to run some&amp;nbsp;&lt;/SPAN&gt;post-processing of data acquired by an ultrasound system that is controlled by Matlab. I cannot get away with Matlab because it is where the data is coming from. So far my solution is to use Matlab's "fopen" and "fwrite" functions to write the data into a file on the hard drive, and then read in the file using my Fortran codes. I have two questions:&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;1. I am running Matlab 2014a on a Mac OS (10.10) with Intel Fortran 2016 (compilers and libraries 2016.3.170). Under terminal window, I could run the Unix executable fine. But in Matlab's command window, when I run "./myfunction", it gives me the error below:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 700;"&gt;dyld: Library not loaded: @rpath/libmkl_intel_lp64.dylib&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Referenced from: /Volumes/...&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reason: image not found&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; font-weight: 700;"&gt;I know that under the terminal window, I have to always call "source&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;bin/compilervars.sh intel64". I did this in Matlab's command window. It &amp;nbsp; &amp;nbsp;would run but would still gives me the error above when I tried executing my function. Any ideas on how to do this?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;2. The Matlab "fopen" and "fwrite" solution is not optimal. I was thinking about building my Fortran codes with Matlab's mex&amp;nbsp;&lt;/SPAN&gt;function, but mex doesn't seem to support Fortran 2016 on a Mac OS X. Any suggestions on how to efficiently run a Fortran executable that is interacting with Matlab? The main interaction between the two is data input and data output: Matlab raw data -&amp;gt; my Fortran function for processing -&amp;gt; output to Matlab.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 17:41:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-Matlab-interface/m-p/1092207#M124654</guid>
      <dc:creator>Pengfei_S_</dc:creator>
      <dc:date>2016-08-10T17:41:08Z</dc:date>
    </item>
    <item>
      <title>I have no experience with</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-Matlab-interface/m-p/1092208#M124655</link>
      <description>&lt;P&gt;I have no experience with running Matlab on OSX, so my remarks may not apply.&lt;/P&gt;

&lt;P&gt;Are you running a 32-bit version of Matlab, or a 64-bit version? How do you launch Matlab?&lt;/P&gt;

&lt;P&gt;On Linux, I would suggest opening up a shell window, sourcing the Intel startup script, adding the Matlab BIN directory to PATH, adding the directory containing the Matlab shared libraries to LD_LIBRARY_PATH and then running the Matlab application from the same command window.&lt;/P&gt;

&lt;P&gt;Please expand on why you think it is bad to have your Fortran application run as a post-processor. Are the data files being exchanged of very large size? How many times do you run the post-processor?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 21:49:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-Matlab-interface/m-p/1092208#M124655</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2016-08-10T21:49:54Z</dc:date>
    </item>
    <item>
      <title>Quote:mecej4 wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-Matlab-interface/m-p/1092209#M124656</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;mecej4 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I have no experience with running Matlab on OSX, so my remarks may not apply.&lt;/P&gt;

&lt;P&gt;Are you running a 32-bit version of Matlab, or a 64-bit version? How do you launch Matlab?&lt;/P&gt;

&lt;P&gt;On Linux, I would suggest opening up a shell window, sourcing the Intel startup script, adding the Matlab BIN directory to PATH, adding the directory containing the Matlab shared libraries to LD_LIBRARY_PATH and then running the Matlab application from the same command window.&lt;/P&gt;

&lt;P&gt;Please expand on why you think it is bad to have your Fortran application run as a post-processor. Are the data files being exchanged of very large size? How many times do you run the post-processor?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I am running a 64-bit version of Matlab on OSX. I just click the Matlab icon on the dashboard to launch it. Thank you for the shell window idea, I am going to give it a try.&lt;/P&gt;

&lt;P&gt;Sorry maybe I was not clear: I don't think having Fortran application run as a post-processor is a bad idea. It is much faster than Matlab. The Matlab is controlling an ultrasound system which is collecting data with dimensions of about 200 x 200 x 100 in complex double format at a rate of about 20 times per second. So I have to transfer such 200 x 200 x 100 complex double matrix about 20 times a second between Matlab and Fortran. Ideally a gateway that supports fast data transfer between the two would be great. The data is in Matlab's workspace memory on the same Mac that runs the Fortran codes.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 22:45:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-Matlab-interface/m-p/1092209#M124656</guid>
      <dc:creator>Pengfei_S_</dc:creator>
      <dc:date>2016-08-10T22:45:19Z</dc:date>
    </item>
    <item>
      <title>Good; one more question: what</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-Matlab-interface/m-p/1092210#M124657</link>
      <description>&lt;P&gt;Good; one more question: what do you do with the results from the post-processing? In particular, do you pass them back to Matlab?&lt;/P&gt;

&lt;P&gt;I think that you can slightly modify your Fortran code to produce a Mex file that can be called from Matlab with your 200 X 200 X 100 array as input.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 23:06:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-Matlab-interface/m-p/1092210#M124657</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2016-08-10T23:06:18Z</dc:date>
    </item>
    <item>
      <title>Yes I have to pass them back</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-Matlab-interface/m-p/1092211#M124658</link>
      <description>&lt;P&gt;Yes I have to pass them back to Matlab for display, specifically overlaying the result on an existing Matlab figure.&lt;/P&gt;

&lt;P&gt;Do you have an example of how to modify Fortran code to produce a mex file? So far what I could find is in this link:&amp;nbsp;http://www.mathworks.com/help/matlab/matlab_external/create-fortran-source-mex-file.html.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 23:11:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-Matlab-interface/m-p/1092211#M124658</guid>
      <dc:creator>Pengfei_S_</dc:creator>
      <dc:date>2016-08-10T23:11:44Z</dc:date>
    </item>
    <item>
      <title>The example in the link that</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-Matlab-interface/m-p/1092212#M124659</link>
      <description>&lt;P&gt;The example in the link that you provided, and several examples in the Matlab "extern" subdirectory on your computer, can be consulted.&lt;/P&gt;

&lt;P&gt;You have to modify your Fortran source code such that the entry point is a subroutine called mexFunction, with input and output arguments in the way specified in the Matlab documentation.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 02:48:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-Matlab-interface/m-p/1092212#M124659</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2016-08-11T02:48:05Z</dc:date>
    </item>
  </channel>
</rss>

