Coding basics
- A = 1 2 3 4 5
Which define a matrix in (5 rows, 1 column)
- B = 1
2
3
4
5
Which define a row of the matrix
- C = A*B'
the number of columns in the first matrix matches the number of rows in
the second matrix. To perform elementwise multiplication, to perform this operation. C = A.*B' which gives dot product
- C = B*A
C = 1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25
- A(1:end)
1 2 3 4 5
Which define starting (1) to end (5)
- A(1:2)
1 2
Which define starting (1) to end (2)
- B(1:2,3)
3 row is not available in the matrix so it is not possible
- B(length(B)-2)
3
(5-2) length (5)