From: Rune Allnor <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Long double precision mxArray in mex file?
Date: Thu, 18 Feb 2010 04:35:19 -0800 (PST)
Lines: 19
Message-ID: <>
References: <hljabl$72u$>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: 1266496519 7382 (18 Feb 2010 12:35:19 GMT)
NNTP-Posting-Date: Thu, 18 Feb 2010 12:35:19 +0000 (UTC)
Injection-Info:; posting-host=; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; 
	Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; 
	.NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
Xref: comp.soft-sys.matlab:609216

On 18 Feb, 13:04, "Christian " <> wrote:
> Hello all
> I am trying to model a communication system in Matlab. Because of time computation, I have moved a part of the code into some mex files. When running the program with just Matlab the results are more satisfactory than the results when Matlab/MEX is used. My only explanation for this is a difference of precision in the computations involved

Wrong. Matlab uses double precision arithmetics. If the
matlab results are good, double precision should suffice
in your mex files as well. Another, more likely explanation
is that matlab uses more robust algorithms for whatever
computations are done.

If you want to roll your own, make sure you understand the
ins and outs of the numerics.