Project

Basic codes

1)A=[1,2,3,4,5] gives us a row vector with 5 colums. The dimension of the matrix obtained has a dimension 1x5

2)The output of the second command gives a column matrix with5 rows and sigle column i.e., 5x1

3)We donot get any output with the following command as we cannot multiply a row vector with another row vector

4)In the 4th case we get a single number as the answer, which in this case is 55.

5)With the execution of the 4th command we get the same matrix as the answer

6)With the execution of 6th command we get the first 2 numbers of the A matrix as the output

7)With the execution of the 7th command we get an error. The command actually enquires about the 3rd column in the 1st and 2nd row of the given matrix. In this case, since we have only one column, we get an error. The command should have been [B(1);B(2);3].

8)we get an answer 3. Since length of B is 5, B(5-2) is B(3) which is 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.