Professional Documents
Culture Documents
v0 a00 a01 ... a0,j ... a0,n−1
v1
a10 a11 ... a1,j
... a1,n−1
.. .. .. .. .. ..
. . . . .. . . .
v=
vi ,
A=
ai,0
,
ai,1 ... ai,j . . . a2,n−1
.. .. .. .. .. .. ..
. . . . . . .
vm−1 an−1,0 an−1,1 . . . an−1,2 . . . an−1,n−1
or in short form,
1. Vector/Matrix summation:
m−1
X
w = Av = (wi ) = aik ∗ vk , i = 0, . . . , m − 1 (2)
k=0
l−1
X
C = A ∗ B = (cij ) = aik ∗ bkj , i = 0, . . . , m − 1, j = 0, . . . , n − 1 (3)
k=0
4. Dot product: let α ∈ R be a scalar. The dot product of 2 vectors of the same size is
m−1
X
α=v·w = v i ∗ wi (4)
i=0
ECE Programming 2 Page 2 of 3
2 Programming exercises
Write a C++ program to compute the following
7. Use, e.g., MATLAB, to double compare the errors between the two obtained results.
Page 2
ECE Programming 2 Page 3 of 3
Listing 1: Coding1.cpp
Page 3