<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: What Version is Being Used?</title>
	<link>http://blogs.mathworks.com/loren/2007/11/14/what-version-is-being-used/</link>
	<description>Loren Shure  works on design of the MATLAB language at &#60;a href="http://www.mathworks.com/"&#62;The MathWorks&#60;/a&#62;. She writes here about once a week on MATLAB programming and related topics. &#60;br&#62;&#60;br&#62;&#60;a href="/images/loren-full.jpg"&#62;&#60;img src="/images/loren.jpg"&#62;&#60;/a&#62;</description>
	<pubDate>Sun, 08 Nov 2009 04:08:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Tim Davis</title>
		<link>http://blogs.mathworks.com/loren/2007/11/14/what-version-is-being-used/#comment-22093</link>
		<dc:creator>Tim Davis</dc:creator>
		<pubDate>Mon, 26 Nov 2007 03:18:16 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/11/14/what-version-is-being-used/#comment-22093</guid>
		<description>In addition, the #define for MATLAB_VERSION should be ported back to older MATLAB versions, say in a #include "mex_version.h" file that could be back-ported.  This mex_version.h file would figure out the MATLAB version number using details of the kind of #define's inside the mex.h file, such as:
#ifndef MATLAB_VERION
#ifdef mxSignedInt

   MATLAB_version 7.3 (or whatever) to 7.5; use other
   aspects of mex.h to figure out which one.

#else

   this is MATLAB 7.2 or earlier, etc.

#endif

#else

this must be MATLAB 7.6 (or whatever) that has MATLAB_VERSION defined already

#endif

I'd write such a mex_version.h myself, but it would require some pretty deep analysis of the mex.h file and all the files it includes, to figure out what the best #if tests are.  It would be best be done by someone at The MathWorks.</description>
		<content:encoded><![CDATA[<p>In addition, the #define for MATLAB_VERSION should be ported back to older MATLAB versions, say in a #include &#8220;mex_version.h&#8221; file that could be back-ported.  This mex_version.h file would figure out the MATLAB version number using details of the kind of #define&#8217;s inside the mex.h file, such as:<br />
#ifndef MATLAB_VERION<br />
#ifdef mxSignedInt</p>
<p>   MATLAB_version 7.3 (or whatever) to 7.5; use other<br />
   aspects of mex.h to figure out which one.</p>
<p>#else</p>
<p>   this is MATLAB 7.2 or earlier, etc.</p>
<p>#endif</p>
<p>#else</p>
<p>this must be MATLAB 7.6 (or whatever) that has MATLAB_VERSION defined already</p>
<p>#endif</p>
<p>I&#8217;d write such a mex_version.h myself, but it would require some pretty deep analysis of the mex.h file and all the files it includes, to figure out what the best #if tests are.  It would be best be done by someone at The MathWorks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Davis</title>
		<link>http://blogs.mathworks.com/loren/2007/11/14/what-version-is-being-used/#comment-22092</link>
		<dc:creator>Tim Davis</dc:creator>
		<pubDate>Mon, 26 Nov 2007 03:12:35 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/11/14/what-version-is-being-used/#comment-22092</guid>
		<description>It would be very helpful if there were a MATLAB_VERSION #define'd for use in a C/C++ mexFunction.  For example:

#if MATLAB_VERSION &#62;= 7.3
#define Int mxSignedIndex
#else
#define Int int
#endif

...

    Int *p = mxGetJc ( ... ) ;

The new mx data type for an integer can't be used in mexFunctions that attempt to port to older versions of MATLAB.  Thus, I just use "long" and skip the use of mxSignedIndex that appeared in MATLAB 7.4 (or was it 7.3...?  whichever ...).

The lack of a MATLAB_VERSION makes porting a mexFunction for different versions of MATLAB (both 32-bit and 64-bit) very very tricky, particularly ones that deal with sparse matrices since the mexFunction needs to know how the integers are stored inside the sparse matrix (32 or 64 bits).

Those who write M-files don't have to worry about this, but mexFunction authors do.</description>
		<content:encoded><![CDATA[<p>It would be very helpful if there were a MATLAB_VERSION #define&#8217;d for use in a C/C++ mexFunction.  For example:</p>
<p>#if MATLAB_VERSION &gt;= 7.3<br />
#define Int mxSignedIndex<br />
#else<br />
#define Int int<br />
#endif</p>
<p>&#8230;</p>
<p>    Int *p = mxGetJc ( &#8230; ) ;</p>
<p>The new mx data type for an integer can&#8217;t be used in mexFunctions that attempt to port to older versions of MATLAB.  Thus, I just use &#8220;long&#8221; and skip the use of mxSignedIndex that appeared in MATLAB 7.4 (or was it 7.3&#8230;?  whichever &#8230;).</p>
<p>The lack of a MATLAB_VERSION makes porting a mexFunction for different versions of MATLAB (both 32-bit and 64-bit) very very tricky, particularly ones that deal with sparse matrices since the mexFunction needs to know how the integers are stored inside the sparse matrix (32 or 64 bits).</p>
<p>Those who write M-files don&#8217;t have to worry about this, but mexFunction authors do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/11/14/what-version-is-being-used/#comment-21451</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Fri, 16 Nov 2007 15:19:17 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/11/14/what-version-is-being-used/#comment-21451</guid>
		<description>Yes Matt, that's true.  There was a bug using ver with the MATLAB Compiler and it has been fixed.

--Loren</description>
		<content:encoded><![CDATA[<p>Yes Matt, that&#8217;s true.  There was a bug using ver with the MATLAB Compiler and it has been fixed.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Whitaker</title>
		<link>http://blogs.mathworks.com/loren/2007/11/14/what-version-is-being-used/#comment-21312</link>
		<dc:creator>Matt Whitaker</dc:creator>
		<pubDate>Wed, 14 Nov 2007 19:40:52 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/11/14/what-version-is-being-used/#comment-21312</guid>
		<description>Hi Loren,
It should be noted that ver is not available in compiled code prior to R2007b. See tech solution:
http://www.mathworks.com/support/bugreports/details.html?rp=225580</description>
		<content:encoded><![CDATA[<p>Hi Loren,<br />
It should be noted that ver is not available in compiled code prior to R2007b. See tech solution:<br />
<a href="http://www.mathworks.com/support/bugreports/details.html?rp=225580" rel="nofollow">http://www.mathworks.com/support/bugreports/details.html?rp=225580</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
