MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   MWNumericArray精度问题 (https://www.labfans.com/bbs/showthread.php?t=3760)

未注册 2008-06-29 11:08

MWNumericArray精度问题
 
发现MWNumericArray计算精度默认情况下很低(小数点后4位),连C#中的Single都不如,请问各位如何解决?
下面是源代码:
using System;
using MathWorks.MATLAB.NET.Utility;
using MathWorks.MATLAB.NET.Arrays;


class Program
{
static void Main(string[] args)
{
//matlab默认精度远不能满足要求!!!
Random r = new Random();
double rd = r.NextDouble();
Console.WriteLine(rd);
Console.WriteLine((Single)rd);
MWNumericArray C = (MWNumericArray)rd;
Console.WriteLine(C);
Console.WriteLine(C.NumericType);
}
}

未注册 2011-09-25 17:07

回复: MWNumericArray精度问题
 
c.getdouble(1);
其实精度没有损失 只是没有显示出来


所有时间均为北京时间。现在的时间是 06:25

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.