Matrix Addition
-
Hi All, I am new to programming with C#. I have been asked to calulate the sum of the 2x2 matrix and it should display the output on the third matrix. I tried a lot but i could not able to get it. if there is any link also pls send me. pls help me. regards, Chitra
-
Hi All, I am new to programming with C#. I have been asked to calulate the sum of the 2x2 matrix and it should display the output on the third matrix. I tried a lot but i could not able to get it. if there is any link also pls send me. pls help me. regards, Chitra
What code do you have? I take it you haven't tried google - why not?
-
What code do you have? I take it you haven't tried google - why not?
hey i tried google also but i could not able to get the correct thing which i m needed. regatds, Chitra.
-
Hi All, I am new to programming with C#. I have been asked to calulate the sum of the 2x2 matrix and it should display the output on the third matrix. I tried a lot but i could not able to get it. if there is any link also pls send me. pls help me. regards, Chitra
hello chitra. the following link might probably help you. http://www.extremeoptimization.com/mathematics/samples/MSharp.aspx
Keshav Kamat :) India
-
Hi All, I am new to programming with C#. I have been asked to calulate the sum of the 2x2 matrix and it should display the output on the third matrix. I tried a lot but i could not able to get it. if there is any link also pls send me. pls help me. regards, Chitra
the earlier link was for a M# language. this link is much better http://www.codeproject.com/csharp/psdotnetmatrix.asp
Keshav Kamat :) India
-
Hi All, I am new to programming with C#. I have been asked to calulate the sum of the 2x2 matrix and it should display the output on the third matrix. I tried a lot but i could not able to get it. if there is any link also pls send me. pls help me. regards, Chitra
Check this link as well. http://www.extremeoptimization.com/QuickStart/MatrixVectorOperationsCS.aspx
Keshav Kamat :) India
-
Check this link as well. http://www.extremeoptimization.com/QuickStart/MatrixVectorOperationsCS.aspx
Keshav Kamat :) India
Hi Keshav, Thanks for your reply. And i tried it like this. here is the code for ur ref I am running it in the console application Matrix.cs file
namespace MatrixAddition { public class Matrix { public double[,] Data; public Matrix(double[,] data) { Data = data; } public static Matrix operator +(Matrix M1, Matrix M2) { int r1 = M1.Data.GetLength(0); int c1 = M1.Data.GetLength(1); int r2 = M2.Data.GetLength(0); int c2 = M2.Data.GetLength(1); double[,] res = new double[r1, c1]; for (int i = 0; i < r1; i++) { for (int j = 0; j < c1; j++) { res[i, j] = M1.Data[i, j] + M2.Data[i, j]; } } return new Matrix(res); } } }
them i am trying to call it in the main fumction but i could not able to get it. pls correct my code in the matrix.cs page and tell me how to call it in the main program. waiting for reply regards, chitra. -
Hi Keshav, Thanks for your reply. And i tried it like this. here is the code for ur ref I am running it in the console application Matrix.cs file
namespace MatrixAddition { public class Matrix { public double[,] Data; public Matrix(double[,] data) { Data = data; } public static Matrix operator +(Matrix M1, Matrix M2) { int r1 = M1.Data.GetLength(0); int c1 = M1.Data.GetLength(1); int r2 = M2.Data.GetLength(0); int c2 = M2.Data.GetLength(1); double[,] res = new double[r1, c1]; for (int i = 0; i < r1; i++) { for (int j = 0; j < c1; j++) { res[i, j] = M1.Data[i, j] + M2.Data[i, j]; } } return new Matrix(res); } } }
them i am trying to call it in the main fumction but i could not able to get it. pls correct my code in the matrix.cs page and tell me how to call it in the main program. waiting for reply regards, chitra.I am not sure but this might help you. this is a simple link explaining, how functions are called in the main class. http://fullycoded.com/?p=203
Keshav Kamat :) India
-
I am not sure but this might help you. this is a simple link explaining, how functions are called in the main class. http://fullycoded.com/?p=203
Keshav Kamat :) India
Thanks for your help . regards, chitra.
-
Thanks for your help . regards, chitra.
u r welcome :)
Keshav Kamat :) India