Create matrix in C#

    static double[][] CreateMatrix(int rows, int cols)
    {
      double[][] result = new double[rows][];
      for (int i = 0; i < rows; ++i)
        result[i] = new double[cols]; // 
      return result;
    }
double[][] m = CreateMatrix(4,3);

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.