<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168834</link>
    <title>MATLAB Central Newsreader - convert C++ code to M-code</title>
    <description>Feed for thread: convert C++ code to M-code</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>Tue, 06 May 2008 23:23:04 -0400</pubDate>
      <title>convert C++ code to M-code</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168834#430678</link>
      <author>carlos </author>
      <description>hi,&lt;br&gt;
&lt;br&gt;
i want to convert a C++/C code to Matlab code (M-file) and &lt;br&gt;
viceversa, what instructions do i need??&lt;br&gt;
&lt;br&gt;
Do you know some simple example that illustrate this?? or &lt;br&gt;
some tutorial in the internet or something about this &lt;br&gt;
topic?? something specific and short if possible&lt;br&gt;
&lt;br&gt;
thanks for your help</description>
    </item>
    <item>
      <pubDate>Wed, 07 May 2008 13:04:12 -0400</pubDate>
      <title>Re: convert C++ code to M-code</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168834#430810</link>
      <author>Peter Boettcher</author>
      <description>&quot;carlos &quot; &amp;lt;pumaju@yahoo.com&amp;gt; writes:&lt;br&gt;
&lt;br&gt;
&amp;gt; hi,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; i want to convert a C++/C code to Matlab code (M-file) and &lt;br&gt;
&amp;gt; viceversa, what instructions do i need??&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Do you know some simple example that illustrate this?? or &lt;br&gt;
&amp;gt; some tutorial in the internet or something about this &lt;br&gt;
&amp;gt; topic?? something specific and short if possible&lt;br&gt;
&lt;br&gt;
2 options:&lt;br&gt;
&lt;br&gt;
1- Use each set of code in it's native format.  From C code, you can&lt;br&gt;
link in the MATLAB engine API and call MATLAB code directly from C.&lt;br&gt;
From MATLAB, you can compile your C/C++ code and call it directly from&lt;br&gt;
MATLAB.  Both require intermediate knowledge of C programming.  See the&lt;br&gt;
&quot;External Interfaces&quot; section of the MATLAB documentation.&lt;br&gt;
&lt;br&gt;
2- Port the code to the other language.  There are no simple rules for&lt;br&gt;
this.  You simply read and understand the algorithm in one language, and&lt;br&gt;
write the code that does the same thing in the other.  Depending on how&lt;br&gt;
complex the code is, when porting from MATLAB to C you might benefit&lt;br&gt;
from the use of a third-party library to help with matrix operations,&lt;br&gt;
such as BLAS/LAPACK, Intel Processing Primitives, or the GNU Scientific&lt;br&gt;
Library.  (Google each of these).  Or, from C to MATLAB, you can often&lt;br&gt;
simplify things tremendously as MATLAB offers many more standard&lt;br&gt;
functions than the C library.&lt;br&gt;
&lt;br&gt;
Good luck,&lt;br&gt;
&lt;br&gt;
-Peter</description>
    </item>
    <item>
      <pubDate>Wed, 07 May 2008 13:17:03 -0400</pubDate>
      <title>Re: convert C++ code to M-code</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168834#430815</link>
      <author>Steve Amphlett</author>
      <description>&quot;carlos &quot; &amp;lt;pumaju@yahoo.com&amp;gt; wrote in message &amp;lt;fvqp8o$9s4&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; hi,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; i want to convert a C++/C code to Matlab code (M-file) &lt;br&gt;
and &lt;br&gt;
&amp;gt; viceversa, what instructions do i need??&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Do you know some simple example that illustrate this?? or &lt;br&gt;
&amp;gt; some tutorial in the internet or something about this &lt;br&gt;
&amp;gt; topic?? something specific and short if possible&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; thanks for your help&lt;br&gt;
&lt;br&gt;
There is no language called C++/C.  If your code is C, &lt;br&gt;
conversion to M should be straightforward and will cut down &lt;br&gt;
your line count considerably.  If your code is C++, you may &lt;br&gt;
find that converting your classes and/or templates will be &lt;br&gt;
tricky.</description>
    </item>
  </channel>
</rss>

