Creating a Matrix
Substituting Within a Symbolic Matrix
Manipulating Regular Matrices
Vectors
Scalar Multiplication
Addition of Matrices
Gauss-Jordan Elimination
Reduced Row-Echelon Form
Dot Product
Rank
Number of Solutions
|
Addition of Matrices
How to
Examples
Exercise
How to:
We can add together any types of matrices (Vectors included), so long as they both have the same
number of rows and columns (i.e. both are MxN). Here we will add regular matrices A and B (assumed to both be MxN) and store the
answer in C:
C = A + B
Symbolic matrices are a little trickier. We cannot just use the '+' sign, we have to use a special function:
C = symadd(A, B)
Examples:
Let's take row vectors rV1 = [1 2 3] and rV2 = [4 5 6], add them together and store it in variable rV3:
rV3 = rV1 + rV2
Now, let's add symbolic row vectors srV1 = sym('[a, b, c]') and srV2 = sym('[d, e, f]') and store it in variable srV3:
srV3 = symadd(srV1, srV2)
Exercise:
Given matrices A = [10 78 81; 65 101 -99; -9 14 100] and B = [1 10 21; -9 -8 11; -76 1 -76], add them together and store
the answer in C.
Click here to see the answer. |