1.获得二维数组的行数列数。
double [,] a=new double [3,2];
//获得该二维数组的行数的方法
int row=a.GetLengh(0);//输出3
//获得该二维数组的列数的方法
int column=a.GetLengh(1);//输出2
2.将二维数组拆分成多个数组
以[n,2]的二维数组为例。
//把二维数组拆分成两个数组
public static void splitArray(doubel [,] value)
{
List<double> list1 = new List<double>();
List<double> list2= new List<double>();
for (int i = 0; i < value.GetLength(0); i++)
{
for (int j = 0; j < value.GetLength(1); j++)
{
if (j == 0)
{
list1 .Add(value[i, j]);
}
else
{
list2.Add(value[i, j]);
}