1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ANEK [815]
3 years ago
5

(14 points) 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. (a) The value in the first row and second column(ie. 2) (b) The value in the third row and third column (ie. 6) (c) All the elements in the first row (d) All the elements in the second column (e) All the elements in the first 2 rows (row 1 & 2) (f) All the elements in the last 2 columns (columns 3 & 4) (g) The elements 3 13 10 8
Computers and Technology
1 answer:
Sonja [21]3 years ago
8 0

Answer:

The Matlab commands for the given index operations and corresponding outputs are given below.

Explanation:

clc   % is used to clear the command window of the Matlab

clear all   % is used to clear the variables stored in Matlab workspace

% We are given a 4x4 matrix

Matlab command:

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

output:

M =

   16     2     3    13

    5    11    10     8

    9     7     6    12

    4    14    15     1

(a) The value in the first row and second column (ie. 2)

Matlab command:

a = M(1,2)

% where a = Matrix(row_1,column_2)

output:

a =

    2

(b) The value in the third row and third column (ie. 6)

Matlab command:

b = M(3,3)

% where b = Matrix(row_3,column_3)

output:

b =

     6  

(c) All the elements in the first row

Matlab command:

c = M(1,:)

% where c = Matrix(row_1,:)

output:

c =

   16     2     3    13

(d) All the elements in the second column

Matlab command:

d = M(:,2)

% where d = Matrix(:,column_2)

output:

d =

    2

   11

    7

   14

(e) All the elements in the first 2 rows (row 1 & 2)

Matlab command:

e = M([1,2],:)

% where e = Matrix([row_1,row_2],:)

output:

e =

   16     2     3    13

    5    11    10     8  

(f) All the elements in the last 2 columns (columns 3 & 4)

Matlab command:

f = M(:,[3,4])

% where f= Matrix(:,[column_3,column_4])

output:

f =  

    3    13

   10     8

    6    12

   15     1

(g) The elements 3 13 10 8

Matlab command:

g = [M(1,3) M(1,4); M(2,3) M(2,4)]

% where g = Matrix(row_1,column_3) M(row_1,column_4); M(row_2,column_3), M(row_2,column_4)

output:

g =

    3    13

   10     8

You might be interested in
3. Which icon image is greater in file size? (Show your working) [2]
kipiarov [429]

Answer:

I would go with b. A 16 colour icon with dimensions of 100 x 100 pixels.

Explanation:

Even though the first colour icon has more colours, the second has double the pizels in the both the height and width.

Hope this answer helps!

5 0
3 years ago
A que generacion pertenecen los gadgets?
alukav5142 [94]

Answer:

English please

Explanation:

8 0
3 years ago
What device enables a pc to retrieve a specific row of data from system memory and place it on the external data bus?
Maksim231197 [3]
Memory controller chip is right. 
8 0
3 years ago
Read 2 more answers
When preparing to communicate a solution to a design problem, you must:?
damaskus [11]
You must Examine the viewpoint of ur audiences
7 0
3 years ago
What is the lower House​
statuscvo [17]
What lower house need context
6 0
3 years ago
Other questions:
  • What is intensity? this is for digital arts
    12·1 answer
  • Which are examples of copyrighted online materials? Check all that apply.
    14·2 answers
  • 2.1 Changes in which factors could cause aggregate demand to shift from AD to AD1? What could happen to the unemployment rate? W
    8·1 answer
  • If you've finished working with a data file but intend to work on it again during your work session, which button would you use
    10·2 answers
  • What is BINARY it is making get confused
    10·1 answer
  • Which statistical measurement tools should be
    8·1 answer
  • How do you give brianliest
    13·1 answer
  • Use ordinary pipes to implement an inter-process communication scheme for message passing between processes. Assume that there a
    12·1 answer
  • is the practice of using the internet to provide healthcare without going to a doctor’s office or hospital.
    15·1 answer
  • What is considered any computer system that isn't a general-purpose pc or server?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!