Project

Coding Basics

1). This statement gives us five values for A which is stored in a horizontal matrix.

Output = 1 2 3 4 5.

2). This statement gives us fives values for B which is stored in a vertical matrix.

Output =

1

2

3

4

5

3). This statement is multiplying the A and transpose of B. It will give an error because it is not mathematically possible to multiply a 1*5 matrix with a 1*5 matrix.

4). This statement is multiplying B matrix with A matrix. Output(5*5 matrix) =

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

5). This statement gives a command to slice A from 1st value to the last value. Output =

1 2 3 4 5

6). This statement gives a command to slice A from 1st value to the 2nd value. Output =

1 2

7). This statement gives a value of 1st and 2nd term in the 3rd column. It will give an error because B is a vertical matrix and it does have any 3rd column.

8). This statement gives us a value of B at position(length(B)-2) location. Output = 3.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.