473,385 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Matrix Addition

3
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 >.<
Feb 23 '07 #1
6 2732
r035198x
13,262 8TB
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?
Feb 23 '07 #2
DeMan
1,806 1GB
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
Feb 23 '07 #3
Banfa
9,065 Expert Mod 8TB
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.
Feb 23 '07 #4
odeac
3
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 ]. . .
Feb 27 '07 #5
Ganon11
3,652 Expert 2GB
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?
Feb 27 '07 #6
odeac
3
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
Feb 27 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Ben Ingram | last post by:
Hi all, I am writing a template matrix class in which the template parameters are the number of rows and number of columns. There are a number of reasons why this is an appropriate tradeoff for...
6
by: memocan | last post by:
#include <iostream> using namespace std; int x; //global variable matrix int main() { x= new float ; //initialize the size now }
8
by: nestini | last post by:
Hello everybody, I am student who just begin learning about programming I want to know what is Sprase Matrix. And would you please show me how to add the 2 Sprase Matrix in C soursecode.
16
by: Martin Jørgensen | last post by:
Hi, I've made a program from numerical recipes. Looks like I'm not allowed to distribute the source code from numerical recipes but it shouldn't even be necessary to do that. My problem is...
20
by: Frank-O | last post by:
Hi , Recently I have been commited to the task of "translating" some complex statistical algorithms from Matlab to C++. The goal is to be three times as fast as matlab ( the latest) . I've...
2
by: DarrenWeber | last post by:
Below is a module (matrix.py) with a class to implement some basic matrix operations on a 2D list. Some things puzzle me about the best way to do this (please don't refer to scipy, numpy and...
0
by: DarrenWeber | last post by:
# Copyright (C) 2007 Darren Lee Weber # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free...
2
by: sarah | last post by:
hi all I'm trying to program a c++ matrix. can anybody help me? how can i attach the file to be programmed with this post? sarah
3
by: PeteJ | last post by:
Hello all.. I wrote code in C to invert n x n matrices, where 1<n<39 and the matrices are guaranteed to be invertible. Prior to this task, I haven't really seen linear algebra since my sophmore...
2
by: rijaalu | last post by:
I am designing a matrix class that performs addition, multicpication, substraction and division. When ever i complie the code it shows an error. include <iostream> using namespace std; class...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.