Project

coding basics

1.A=[1,2,3,4,5] denotes a coloumn vector

2.B=[1;2;3;4;5] denotes a row vector

3.C=A*B\' means A* TRANSPOSE OF B BUT ITS NOT POSSIBLE AS AS Matrix dimension is invalid for multiplication

4.C=B*A means MULTIPLICATION OF B INTO A gives

1 2 3 4 5 as the resultant matrix.
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25

5.A(1:end) gives the resultant matrix from 1st pos to last pos of A. which is 1 2 3 4 5.

6.A(1:2) gives 1 2 as the resultant matrix from 1st to 2nd pos of A.

7.B(1:2,3) means third element of 1st and 2nd row of B which is an invalid as B doesnt have more than 1 coloumns.

8.B(length(B)-2) gives 3 as length of B =5 and subtract 2 from it which gives 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.