1
如何在沒有Excel工作簿對象的情況下計算c#中的T.INV()。有沒有可以幫助我的直接公式或類?我已經使用過「System.Web.UI.DataVisualization」命名空間,但它沒有給我預期的結果。 感謝 Shakeb汗如何在沒有Excel工作簿對象的c#中計算T.INV()
public static double InverseTDistributionfun(int DF, double probability)
{
double Tinv;
try
{
chart.Charting.Chart objChart = new chart.Charting.Chart();
Tinv = objChart.DataManipulator.Statistics.TDistribution(probability,DF, true);
// value = c16 + dup * y30;
}
catch (Exception ex)
{
throw ex;
}
return Tinv;
}
[Microsoft.SqlServer.Server.SqlProcedure]
public static double SQLCLRCsharpSP(int DF, double probability)
{
double _sum = 0.00;
try
{
//if (type == "C")
_sum = InverseTDistributionfun(DF, probability);
//if (type == "A")
//_sum = AlgTInvFun(probability, DF);
}
catch (Exception ex)
{
throw ex;
}
return _sum;
}
你可以顯示你正在嘗試使用的代碼嗎? – doctorlove 2014-09-22 12:04:36
這是否是http://stackoverflow.com/questions/20963192/c-sharp-equivalent-of-excels-tinv-function的重複? – doctorlove 2014-09-22 12:06:22
它不重複TINV()和T.INV()是不同的功能。它在Excel 2010以後的版本中引入。 – 2014-09-22 12:13:57