Consider the Matrix M 16 2 3 13 5 11 10 8 9 7 6 12 4 14 15

Consider the Matrix. M = [16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1 Using the index operations write MATLAB statements to retrieve the following. The value in the first row and second column(ie. 2) The value in the third row and third column (ie. 6) All the elements in the first row All the elements in the second column All the elements in the first 2 rows (row 1 &: 2) All the elements in the last 2 columns (columns 3 &: 4) The elements [3 18 10 8]

Solution

>> A=[16 2 3 13;5 11 10 8;9 7 6 12; 9 14 15 1]

A =

16 2 3 13
5 11 10 8
9 7 6 12
9 14 15 1

>> A(1,2)

ans =

2

>> A(3,3)

ans =

6

>> A(1,:)

ans =

16 2 3 13

>> A(:,2)

ans =

2
11
7
14

 Consider the Matrix. M = [16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1 Using the index operations write MATLAB statements to retrieve the following. The value in the

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site