<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158259</link>
    <title>MATLAB Central Newsreader - MEX FORTRAN programming</title>
    <description>Feed for thread: MEX FORTRAN programming</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 24 Oct 2007 16:48:44 -0400</pubDate>
      <title>MEX FORTRAN programming</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158259#398214</link>
      <author>Weijie </author>
      <description>This is probably a least discussed/documented topic, but it&lt;br&gt;
could be very useful as we have so many (old) Fortran code&lt;br&gt;
in scientific computation and we have so few Fortran&lt;br&gt;
programmers nowadays. I'm posting here on what I plan to do&lt;br&gt;
and your experience/hints may save my time.&lt;br&gt;
&lt;br&gt;
In Matlab, I would like to call&lt;br&gt;
M&amp;gt;[r1,r2...]=myfnc(v1,str1,str2,par1,par2,mpar1,mpar2,mpar3...)&lt;br&gt;
where myfnc is a compiled MEX function that use mexFunction&lt;br&gt;
and old Fortran code to do the computation task; v1 is a&lt;br&gt;
vector parameter, str1 and str2 are two strings representing&lt;br&gt;
the names of two Matlab functions (.m files). par1 and par2&lt;br&gt;
are other parameters to myfnc; mpar1,mpar2...are input&lt;br&gt;
arguments to str1.m and str2.m (assume they have exactly the&lt;br&gt;
same arguments). In the mex function, I'll call a Fortran&lt;br&gt;
function (previously developed and tested):&lt;br&gt;
&lt;br&gt;
call oldfnc(n, d, x, objf, objg, iv, liv, lv, v, uip,urp,ufp)&lt;br&gt;
&lt;br&gt;
where objf and objg are two Fortran functions and uip, urp,&lt;br&gt;
and ufp are user-defined parameters input to objf and objg.&lt;br&gt;
&lt;br&gt;
Now, in the Fortran functions objf and objg that I define, I&lt;br&gt;
would like to use mexCallMATLAB(...) to call str1.m and&lt;br&gt;
str2.m respectively. &lt;br&gt;
&lt;br&gt;
It's easy to see that once I done all these, the users can&lt;br&gt;
define their own str1.m and str2.m and call myfnc to do&lt;br&gt;
thier job using the old Fortran package.&lt;br&gt;
&lt;br&gt;
The key difficulty is that: how to transfer mpar1,&lt;br&gt;
mpar2...to uip, urp, and ufp in mes function AND then, in&lt;br&gt;
objf and objg, how to transfer uip, urp, and ufp to input&lt;br&gt;
arguments of mexCallMATLAB function?&lt;br&gt;
&lt;br&gt;
Thanks a million! I'd share my experience once I complete&lt;br&gt;
this project.</description>
    </item>
    <item>
      <pubDate>Wed, 24 Oct 2007 19:23:32 -0400</pubDate>
      <title>Re: MEX FORTRAN programming</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158259#398243</link>
      <author>dpb</author>
      <description>Weijie wrote:&lt;br&gt;
...&lt;br&gt;
&amp;gt; In Matlab, I would like to call&lt;br&gt;
&amp;gt; M&amp;gt;[r1,r2...]=myfnc(v1,str1,str2,par1,par2,mpar1,mpar2,mpar3...)&lt;br&gt;
&amp;gt; where myfnc is a compiled MEX function that use mexFunction&lt;br&gt;
&amp;gt; and old Fortran code to do the computation task; v1 is a&lt;br&gt;
&amp;gt; vector parameter, str1 and str2 are two strings representing&lt;br&gt;
&amp;gt; the names of two Matlab functions (.m files). par1 and par2&lt;br&gt;
&amp;gt; are other parameters to myfnc; mpar1,mpar2...are input&lt;br&gt;
&amp;gt; arguments to str1.m and str2.m (assume they have exactly the&lt;br&gt;
&amp;gt; same arguments). In the mex function, I'll call a Fortran&lt;br&gt;
&amp;gt; function (previously developed and tested):&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; call oldfnc(n, d, x, objf, objg, iv, liv, lv, v, uip,urp,ufp)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; where objf and objg are two Fortran functions and uip, urp,&lt;br&gt;
&amp;gt; and ufp are user-defined parameters input to objf and objg.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Now, in the Fortran functions objf and objg that I define, I&lt;br&gt;
&amp;gt; would like to use mexCallMATLAB(...) to call str1.m and&lt;br&gt;
&amp;gt; str2.m respectively. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; It's easy to see that once I done all these, the users can&lt;br&gt;
&amp;gt; define their own str1.m and str2.m and call myfnc to do&lt;br&gt;
&amp;gt; thier job using the old Fortran package.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The key difficulty is that: how to transfer mpar1,&lt;br&gt;
&amp;gt; mpar2...to uip, urp, and ufp in mes function AND then, in&lt;br&gt;
&amp;gt; objf and objg, how to transfer uip, urp, and ufp to input&lt;br&gt;
&amp;gt; arguments of mexCallMATLAB function?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks a million! I'd share my experience once I complete&lt;br&gt;
&amp;gt; this project.&lt;br&gt;
&lt;br&gt;
The parameters to the called function would have to be wrapped in &lt;br&gt;
mxArray per the calling protocol as expected by mexCallMATLAB.  The user &lt;br&gt;
parameters and functions have to be aware of the expectations on both &lt;br&gt;
the caller and the callee side.  Other than that, I don't see the problem?&lt;br&gt;
&lt;br&gt;
--</description>
    </item>
    <item>
      <pubDate>Wed, 24 Oct 2007 20:51:02 -0400</pubDate>
      <title>Re: MEX FORTRAN programming</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158259#398261</link>
      <author>Weijie </author>
      <description>dpb &amp;lt;none@non.net&amp;gt; wrote in message &amp;lt;ffo69s$2pf$1@aioe.org&amp;gt;...&lt;br&gt;
&amp;gt; Weijie wrote:&lt;br&gt;
&amp;gt; ...&lt;br&gt;
&amp;gt; &amp;gt; In Matlab, I would like to call&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
M&amp;gt;[r1,r2...]=myfnc(v1,str1,str2,par1,par2,mpar1,mpar2,mpar3...)&lt;br&gt;
&amp;gt; &amp;gt; where myfnc is a compiled MEX function that use mexFunction&lt;br&gt;
&amp;gt; &amp;gt; and old Fortran code to do the computation task; v1 is a&lt;br&gt;
&amp;gt; &amp;gt; vector parameter, str1 and str2 are two strings representing&lt;br&gt;
&amp;gt; &amp;gt; the names of two Matlab functions (.m files). par1 and par2&lt;br&gt;
&amp;gt; &amp;gt; are other parameters to myfnc; mpar1,mpar2...are input&lt;br&gt;
&amp;gt; &amp;gt; arguments to str1.m and str2.m (assume they have exactly the&lt;br&gt;
&amp;gt; &amp;gt; same arguments). In the mex function, I'll call a Fortran&lt;br&gt;
&amp;gt; &amp;gt; function (previously developed and tested):&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; call oldfnc(n, d, x, objf, objg, iv, liv, lv, v,&lt;br&gt;
uip,urp,ufp)&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; where objf and objg are two Fortran functions and uip, urp,&lt;br&gt;
&amp;gt; &amp;gt; and ufp are user-defined parameters input to objf and objg.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Now, in the Fortran functions objf and objg that I define, I&lt;br&gt;
&amp;gt; &amp;gt; would like to use mexCallMATLAB(...) to call str1.m and&lt;br&gt;
&amp;gt; &amp;gt; str2.m respectively. &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; It's easy to see that once I done all these, the users can&lt;br&gt;
&amp;gt; &amp;gt; define their own str1.m and str2.m and call myfnc to do&lt;br&gt;
&amp;gt; &amp;gt; thier job using the old Fortran package.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; The key difficulty is that: how to transfer mpar1,&lt;br&gt;
&amp;gt; &amp;gt; mpar2...to uip, urp, and ufp in mes function AND then, in&lt;br&gt;
&amp;gt; &amp;gt; objf and objg, how to transfer uip, urp, and ufp to input&lt;br&gt;
&amp;gt; &amp;gt; arguments of mexCallMATLAB function?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thanks a million! I'd share my experience once I complete&lt;br&gt;
&amp;gt; &amp;gt; this project.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The parameters to the called function would have to be&lt;br&gt;
wrapped in &lt;br&gt;
&amp;gt; mxArray per the calling protocol as expected by&lt;br&gt;
mexCallMATLAB.  The user &lt;br&gt;
&amp;gt; parameters and functions have to be aware of the&lt;br&gt;
expectations on both &lt;br&gt;
&amp;gt; the caller and the callee side.  Other than that, I don't&lt;br&gt;
see the problem?&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
The problem is just how to wrap-up the parameters. I forgot&lt;br&gt;
to note that uip must be an integer vector, and urp must be&lt;br&gt;
a float vector. To avoid the pack-unpack, I tried to use the&lt;br&gt;
static (global) variables like the following:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MODULE global&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;character*10 :: MATLAB_OBJ_NAME,MATLAB_GRAD_NAME&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mwPointer :: mprhs, mplhs&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;END MODULE global&lt;br&gt;
&lt;br&gt;
The idea is that, then in the mexFunction, I got the&lt;br&gt;
contents of MATLAB_OBJ_NAME from str1, and other input&lt;br&gt;
arguments from prhs (e.g., mprhs=prhs(3)). Then in the objf,&lt;br&gt;
I set the nlhs and nrhs and together with the global&lt;br&gt;
variables mprhs, mplhs, and MATLAB_OBJ_NAME to call&lt;br&gt;
mexCallMATLAB function. But it's not working so far....am I&lt;br&gt;
in the right direction?</description>
    </item>
    <item>
      <pubDate>Wed, 24 Oct 2007 20:52:05 -0400</pubDate>
      <title>Re: MEX FORTRAN programming</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158259#398262</link>
      <author>Weijie </author>
      <description>dpb &amp;lt;none@non.net&amp;gt; wrote in message &amp;lt;ffo69s$2pf$1@aioe.org&amp;gt;...&lt;br&gt;
&amp;gt; Weijie wrote:&lt;br&gt;
&amp;gt; ...&lt;br&gt;
&amp;gt; &amp;gt; In Matlab, I would like to call&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
M&amp;gt;[r1,r2...]=myfnc(v1,str1,str2,par1,par2,mpar1,mpar2,mpar3...)&lt;br&gt;
&amp;gt; &amp;gt; where myfnc is a compiled MEX function that use mexFunction&lt;br&gt;
&amp;gt; &amp;gt; and old Fortran code to do the computation task; v1 is a&lt;br&gt;
&amp;gt; &amp;gt; vector parameter, str1 and str2 are two strings representing&lt;br&gt;
&amp;gt; &amp;gt; the names of two Matlab functions (.m files). par1 and par2&lt;br&gt;
&amp;gt; &amp;gt; are other parameters to myfnc; mpar1,mpar2...are input&lt;br&gt;
&amp;gt; &amp;gt; arguments to str1.m and str2.m (assume they have exactly the&lt;br&gt;
&amp;gt; &amp;gt; same arguments). In the mex function, I'll call a Fortran&lt;br&gt;
&amp;gt; &amp;gt; function (previously developed and tested):&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; call oldfnc(n, d, x, objf, objg, iv, liv, lv, v,&lt;br&gt;
uip,urp,ufp)&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; where objf and objg are two Fortran functions and uip, urp,&lt;br&gt;
&amp;gt; &amp;gt; and ufp are user-defined parameters input to objf and objg.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Now, in the Fortran functions objf and objg that I define, I&lt;br&gt;
&amp;gt; &amp;gt; would like to use mexCallMATLAB(...) to call str1.m and&lt;br&gt;
&amp;gt; &amp;gt; str2.m respectively. &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; It's easy to see that once I done all these, the users can&lt;br&gt;
&amp;gt; &amp;gt; define their own str1.m and str2.m and call myfnc to do&lt;br&gt;
&amp;gt; &amp;gt; thier job using the old Fortran package.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; The key difficulty is that: how to transfer mpar1,&lt;br&gt;
&amp;gt; &amp;gt; mpar2...to uip, urp, and ufp in mes function AND then, in&lt;br&gt;
&amp;gt; &amp;gt; objf and objg, how to transfer uip, urp, and ufp to input&lt;br&gt;
&amp;gt; &amp;gt; arguments of mexCallMATLAB function?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thanks a million! I'd share my experience once I complete&lt;br&gt;
&amp;gt; &amp;gt; this project.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The parameters to the called function would have to be&lt;br&gt;
wrapped in &lt;br&gt;
&amp;gt; mxArray per the calling protocol as expected by&lt;br&gt;
mexCallMATLAB.  The user &lt;br&gt;
&amp;gt; parameters and functions have to be aware of the&lt;br&gt;
expectations on both &lt;br&gt;
&amp;gt; the caller and the callee side.  Other than that, I don't&lt;br&gt;
see the problem?&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
The problem is just how to wrap-up the parameters. I forgot&lt;br&gt;
to note that uip must be an integer vector, and urp must be&lt;br&gt;
a float vector. To avoid the pack-unpack, I tried to use the&lt;br&gt;
static (global) variables like the following:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MODULE global&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;character*10 :: MATLAB_OBJ_NAME,MATLAB_GRAD_NAME&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mwPointer :: mprhs, mplhs&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;END MODULE global&lt;br&gt;
&lt;br&gt;
The idea is that, then in the mexFunction, I got the&lt;br&gt;
contents of MATLAB_OBJ_NAME from str1, and other input&lt;br&gt;
arguments from prhs (e.g., mprhs=prhs(3)). Then in the objf,&lt;br&gt;
I set the nlhs and nrhs and together with the global&lt;br&gt;
variables mprhs, mplhs, and MATLAB_OBJ_NAME to call&lt;br&gt;
mexCallMATLAB function. But it's not working so far....am I&lt;br&gt;
in the right direction?</description>
    </item>
    <item>
      <pubDate>Thu, 25 Oct 2007 04:51:05 -0400</pubDate>
      <title>Re: MEX FORTRAN programming</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158259#398290</link>
      <author>James Tursa</author>
      <description>On Wed, 24 Oct 2007 20:52:05 +0000 (UTC), &quot;Weijie &quot;&lt;br&gt;
&amp;lt;mricad@yahoo.no000spppam.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;dpb &amp;lt;none@non.net&amp;gt; wrote in message &amp;lt;ffo69s$2pf$1@aioe.org&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; Weijie wrote:&lt;br&gt;
&amp;gt;&amp;gt; ...&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; In Matlab, I would like to call&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;M&amp;gt;[r1,r2...]=myfnc(v1,str1,str2,par1,par2,mpar1,mpar2,mpar3...)&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; where myfnc is a compiled MEX function that use mexFunction&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; and old Fortran code to do the computation task; v1 is a&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; vector parameter, str1 and str2 are two strings representing&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; the names of two Matlab functions (.m files). par1 and par2&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; are other parameters to myfnc; mpar1,mpar2...are input&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; arguments to str1.m and str2.m (assume they have exactly the&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; same arguments). In the mex function, I'll call a Fortran&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; function (previously developed and tested):&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; call oldfnc(n, d, x, objf, objg, iv, liv, lv, v,&lt;br&gt;
&amp;gt;uip,urp,ufp)&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; where objf and objg are two Fortran functions and uip, urp,&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; and ufp are user-defined parameters input to objf and objg.&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Now, in the Fortran functions objf and objg that I define, I&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; would like to use mexCallMATLAB(...) to call str1.m and&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; str2.m respectively. &lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; It's easy to see that once I done all these, the users can&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; define their own str1.m and str2.m and call myfnc to do&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; thier job using the old Fortran package.&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; The key difficulty is that: how to transfer mpar1,&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; mpar2...to uip, urp, and ufp in mes function AND then, in&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; objf and objg, how to transfer uip, urp, and ufp to input&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; arguments of mexCallMATLAB function?&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Thanks a million! I'd share my experience once I complete&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; this project.&lt;br&gt;
&amp;gt;&amp;gt; &lt;br&gt;
&amp;gt;&amp;gt; The parameters to the called function would have to be&lt;br&gt;
&amp;gt;wrapped in &lt;br&gt;
&amp;gt;&amp;gt; mxArray per the calling protocol as expected by&lt;br&gt;
&amp;gt;mexCallMATLAB.  The user &lt;br&gt;
&amp;gt;&amp;gt; parameters and functions have to be aware of the&lt;br&gt;
&amp;gt;expectations on both &lt;br&gt;
&amp;gt;&amp;gt; the caller and the callee side.  Other than that, I don't&lt;br&gt;
&amp;gt;see the problem?&lt;br&gt;
&amp;gt;&amp;gt; &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;The problem is just how to wrap-up the parameters. I forgot&lt;br&gt;
&amp;gt;to note that uip must be an integer vector, and urp must be&lt;br&gt;
&amp;gt;a float vector. To avoid the pack-unpack, I tried to use the&lt;br&gt;
&amp;gt;static (global) variables like the following:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;      MODULE global&lt;br&gt;
&amp;gt;        character*10 :: MATLAB_OBJ_NAME,MATLAB_GRAD_NAME&lt;br&gt;
&amp;gt;        mwPointer :: mprhs, mplhs&lt;br&gt;
&amp;gt;      END MODULE global&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;The idea is that, then in the mexFunction, I got the&lt;br&gt;
&amp;gt;contents of MATLAB_OBJ_NAME from str1, and other input&lt;br&gt;
&amp;gt;arguments from prhs (e.g., mprhs=prhs(3)). Then in the objf,&lt;br&gt;
&amp;gt;I set the nlhs and nrhs and together with the global&lt;br&gt;
&amp;gt;variables mprhs, mplhs, and MATLAB_OBJ_NAME to call&lt;br&gt;
&amp;gt;mexCallMATLAB function. But it's not working so far....am I&lt;br&gt;
&amp;gt;in the right direction?&lt;br&gt;
&lt;br&gt;
I am still not quite sure what the basic problem is. Are you simply&lt;br&gt;
trying to convert mexFunction input prhs() mxArray pointers into&lt;br&gt;
Fortran variables? And then at some point later on convert Fortran&lt;br&gt;
variables into mxArray pointers for use with the mexCallMATLAB&lt;br&gt;
function?  Are you doing this only for integer scalar, integer rank 1,&lt;br&gt;
rank 2, ...? Float scalar, rank 1, 2, ...?  Just real or possibly&lt;br&gt;
complex? Do you need your code to check to see if integer compiles as&lt;br&gt;
integer*4 or integer*8? Do you need to handle dynamically sized&lt;br&gt;
variables (i.e., allocatable) or will they always be the same fixed&lt;br&gt;
size? Etc etc. And what do you mean by &quot;not working?&quot; Are you getting&lt;br&gt;
the MATLAB version of a stack dump?  Is it not compiling?  I can help&lt;br&gt;
with all of this if you can be more specific.&lt;br&gt;
&lt;br&gt;
James Tursa</description>
    </item>
    <item>
      <pubDate>Thu, 25 Oct 2007 14:30:48 -0400</pubDate>
      <title>Re: MEX FORTRAN programming</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158259#398377</link>
      <author>dpb</author>
      <description>Weijie wrote:&lt;br&gt;
...&lt;br&gt;
&amp;gt; The problem is just how to wrap-up the parameters. ...&lt;br&gt;
...&lt;br&gt;
&amp;gt; ...But it's not working so far....am I&lt;br&gt;
&amp;gt; in the right direction?&lt;br&gt;
&lt;br&gt;
Can't tell -- as James says, it's not clear what &quot;not working&quot; means nor &lt;br&gt;
where your problems really are from your description.&lt;br&gt;
&lt;br&gt;
What would be simplest to try to follow/debug would be a _minimal_ &lt;br&gt;
outline of the code to read rather than the verbal description.  Include &lt;br&gt;
actual error messages, not translations of them.&lt;br&gt;
&lt;br&gt;
--</description>
    </item>
  </channel>
</rss>

