Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!a18g2000yqc.googlegroups.com!not-for-mail
From: Rune Allnor <allnor@tele.ntnu.no>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Long double precision mxArray in mex file?
Date: Thu, 18 Feb 2010 04:35:19 -0800 (PST)
Organization: http://groups.google.com
Lines: 19
Message-ID: <a87725e5-154a-4b58-b81a-17e2a70b36bf@a18g2000yqc.googlegroups.com>
References: <hljabl$72u$1@fred.mathworks.com>
NNTP-Posting-Host: 77.19.18.135
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1266496519 7382 127.0.0.1 (18 Feb 2010 12:35:19 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 18 Feb 2010 12:35:19 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: a18g2000yqc.googlegroups.com; posting-host=77.19.18.135; 
	posting-account=VAp5gAkAAAAmkCze5hvZtMeedpZWNthI
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: news.mathworks.com comp.soft-sys.matlab:609216

On 18 Feb, 13:04, "Christian " <pep...@hotmail.com> 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.

Rune