大家给我帮帮忙关于C#和Matlab混编程的问题
Matlab的源码是function final_perf = netcalculator(perf, lev, m_fee, p_fee, rf)% perf 是一个double数组
% lev是一个double
% m_fee是一个double
% p_fee是一个double
% rf是一个double
C#的源码是
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using MathWorks.
using MathWorks.
using netperfcal; //
private void button3_Click(object sender, EventArgs e)
{
// declare vectors
MWNumericArray Leverage = double.Parse(textBox2.Text);;
MWNumericArray RiskFreeRate = double.Parse(textBox5.Text);
MWNumericArray ManagementFee = double.Parse(textBox3.Text);
MWNumericArray PerformanceFee = double.Parse(textBox4.Text);
MWArray[] vector = null;
MWArray[] argOut = null;
if (dataGridView1.DataSource != null)
{
for (int i = 0; i < dataGridView1.RowCount - 1; i++)
{
vector = double.Parse(dataGridView1.Rows.Cells[1].Value.ToString()); // 出错!vector的数据来自dataGridView1
}
}
netperfcalclass calculation = new netperfcalclass();
argOut = ("vector", "db_Leverage", "db_ManagementFee", "db_PerformanceFee", "db_RiskFreeRate"); //出错!
for (int j = 0; j < dataGridView1.RowCount - 1; j++)
{
// int row = dataGridView2.Rows.Add();
dataGridView2.Rows[j].Cells[1].Value = argOut[j];
}
请麻烦大家帮我看看吧!