This project has moved. For the latest updates, please go here.

Input form console to matrix

Apr 2, 2013 at 3:04 PM
hy,

Im new in C#, OOP and Math.NET so dot be to harsh on me :)
How to insert data in matrix from console instead "hard coded" in program?
I created new empty matrix as follows:
            a = new Matrix(new double[][] {
                new double[] {0, 0, 0},
                new double[] {0, 0, 0},
                new double[] {0, 0, 0} });
and then im trying to insert the data with Parse method:
foreach (string input in Console.ReadLine().Split())
            {
                a.Add(int.Parse(input));
            }
but it there is error that I cant convert int to double. so I tried to change type of data in matrix but when i change double to int in definition of matrix it also get me the same error. What should I do?
Coordinator
Apr 4, 2013 at 5:06 PM
You may want to try double.Parse instead of int.Parse then.

Thanks,
Christoph