日期:2014-05-18  浏览次数:20824 次

各位高人,能不能帮小弟把C#的代码转 VB.NET
fitfunc.FitfunClass p = new fitfunc.FitfunClass();
  double[] x = new double[3] { 1, 2, 1 };
  double[] y = new double[3] { 2, 5, -1 };
  double[] z = new double[3] { 10, 20, 3 };
  MWNumericArray x1 = new MWNumericArray(3, 1, x);
  MWNumericArray y1 = new MWNumericArray(3, 1, y);
  MWNumericArray z1 = new MWNumericArray(3, 1, z);

  MWArray[] output = new MWArray[2];
  output = p.createFit(2, x1, y1, z1);
  MWNumericArray pp = (MWNumericArray)output[0];
  MWNumericArray fl = (MWNumericArray)output[1];
  double[,] ppc = (double[,])pp.ToArray();
  double[,] flc = (double[,])fl.ToArray();

只有30分了

------解决方案--------------------
VB.NET code

Dim p As New fitfunc.FitfunClass()
Dim x As Double() = New Double(2) {1, 2, 1}
Dim y As Double() = New Double(2) {2, 5, -1}
Dim z As Double() = New Double(2) {10, 20, 3}
Dim x1 As New MWNumericArray(3, 1, x)
Dim y1 As New MWNumericArray(3, 1, y)
Dim z1 As New MWNumericArray(3, 1, z)

Dim output As MWArray() = New MWArray(1) {}
output = p.createFit(2, x1, y1, z1)
Dim pp As MWNumericArray = DirectCast(output(0), MWNumericArray)
Dim fl As MWNumericArray = DirectCast(output(1), MWNumericArray)
Dim ppc As Double(,) = DirectCast(pp.ToArray(), Double(,))
Dim flc As Double(,) = DirectCast(fl.ToArray(), Double(,))