Matrix Addition

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • odeac
    New Member
    • Feb 2007
    • 3

    Matrix Addition

    somebody please help me create this program. . .I am to make a c/c++ code that adds two matrices. The user will input the dimension of his matrix to be added (with a maximum of 100x100 dimension). . . thnx >.<
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by odeac
    somebody please help me create this program. . .I am to make a c/c++ code that adds two matrices. The user will input the dimension of his matrix to be added (with a maximum of 100x100 dimension). . . thnx >.<
    What have you done about it so far?

    Comment

    • DeMan
      Top Contributor
      • Nov 2006
      • 1799

      #3
      You won't get complete code.

      Why don't you suggest how you intend to solve the problem, and someone here might be able to help you work through it.

      Try to specify what exactly you are stuck on and any ideas tyou have had

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        A good place to start is to work out how you would add 2 3x3 matricies on paper. Then you can set about formalising that method into an algorithm to deal with any matrix size up to 100x100 and then program that algorithm into your computer.

        Comment

        • odeac
          New Member
          • Feb 2007
          • 3

          #5
          its simple i think, its just that im a noobie at this hehe.
          I am to make somethin that goes. . . Input number of rows, columns. and then i type the entries in the form, A = [ 1 0 3 ] + B = [ 4 5 6 ] for a 3X1 matrix and of course get a result of [ 5 5 9 ]. . .

          Comment

          • Ganon11
            Recognized Expert Specialist
            • Oct 2006
            • 3651

            #6
            Originally posted by odeac
            A = [ 1 0 3 ] + B = [ 4 5 6 ] for a 3X1 matrix and of course get a result of [ 5 5 9 ]. . .
            OK, so let me try to restate this in more general terms:

            You have matrix A and matrix B of some dimensions. If and only if the dimensions of A match the dimensions of B, then the sum of the two matrices (matrix C) is the sum of each element in A added to the corresponding sum of B - this sum is placed in the corresponding element of C.

            Can you take this general idea and make it into a program?

            Comment

            • odeac
              New Member
              • Feb 2007
              • 3

              #7
              Originally posted by Ganon11
              OK, so let me try to restate this in more general terms:

              You have matrix A and matrix B of some dimensions. If and only if the dimensions of A match the dimensions of B, then the sum of the two matrices (matrix C) is the sum of each element in A added to the corresponding sum of B - this sum is placed in the corresponding element of C.

              Can you take this general idea and make it into a program?
              yea thats wat im supposed to make. well hehe i will try making my own version by tomorrow :P

              Comment

              Working...