I have a matrix which is 2 by 11 which I need to concatenate to a m by 11 matrix. Currently I have an event which triggers this operation. I am quite new to C# and haven't done some matrix manipulation so the answer may be very simple.
private double[,] A;
private void Window_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
//variables xk,yk,zk ... assigned here
double[,] a = { { xk, yk, zk, 1, 0, 0, 0, 0, xkxp, ykxp, zkxp }, { 0, 0, 0, 0, xk, yk, zk, 1, xkyp, ykyp, zkyp} };
if (A == null)
{
//On the first event A will be null
A = a;
}
else
{
//Concatenate A and a here
a.CopyTo(A, A.Length);
}
}
Would it be easier if I broke variable "a" into two separate rows? What is the indexing that I need to use?
The A matrix needs to stay or become a double[,] for the operation that I apply to it. The operation doesn't need to happen till the matrix is 'complete' at the end of the program. I thought about just creating an array and then reshaping at the end but I'm not sure how to do this.