منظورت اینه که تعداد بیشتری ماتریس به صورت پویا تعریف کنی ؟
میتونی از این روش استفاده کنی :
public class matrix
{
int[,] ary;
public matrix(int x, int y)
{
ary = new int[x, y];
}
public int this[int x, int y]
{
get { return ary[x, y]; }
set { ary[x, y] = value; }
}
}
static void Main(string[] args)
{
matrix m1 = new matrix(1, 1);
m1[0, 0] = 1;
matrix m2 = new matrix(2, 2);
m2[0, 0] = 1;
m2[0, 1] = 2;
m2[2, 0] = 3;
m2[1, 1] = 4;
Console.Write(m1[0, 0]);
}