Lately we have learned some basics about Matlab matrix operations. Here come the part 2 of that post, where we will test our abilities of manipulating matrices in Matlab

## Matlab matrix operation exercise

### Exercise 1

Create a 1 x 5 vector A with all elements equal to 0

### Exercise 2

Create a 3 x 1 vector B with with all elements equal to 1

### Exercise 3

Create a 1 x 5 vector C with elements equal to 1, 2, 3, 4, π respectively.

### Exercise 4

Create 1-row vector D with element’s from 3 to 27 with step 3 by using the appropriate operator

### Exercise 5

Create a 3 x 3 matrix E with elements with random values.

### Exercise 6

Create the following matrix

### Exercise 7

Check the size of *F*

### Exercise 8

Create the following Matrix

- find the transpose of
*G* - print on display the element G
_{13}of the transpose of*G* - print on display the second row of the transpose of
*G* - print on display the third column of the transpose of
**G** - find the determinant of
*G*

### Exercise 9

Create the following Matrices

- Find the Matrix
*H+J* - Find the Matrix
*H * J* - Multiply
by*H*, element-by-element*J*

### Exercise 10

Solve the linear system of equations ** ax=b** if

### Exercise 11

- Create a 1 x 5 vector with elements with random values
- Use the “
*for*” loop to find the greatest element of the matrix - Use the “
*while*” loop to find the smallest element of the matrix

### Exercise 12

Use the *diag *operator to generate the matrix

### Exercise 13

Let’s consider the following vector

- Define a vector K, K being the vector A sorted in ascending order
- Define a vector L, L being the vector A sorted in Descending order