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
How did hitles rules in nazi germany exemplify totiltarian rule?
ddd [48]

Answer:

hope this helps if not srry

7 0
2 years ago
____________________ are compromised systems that are directed remotely (usually by a transmitted command) by the attacker to pa
Talja [164]

Answer: Zombies

Explanation: Zombie is a computer device that is responsible for the compromising the system and making it prone to several destruction such as the Trojan horse virus,hackers and other viruses as well. Zombie makes the computer system to get malfunctioned easily ,that is without much security and various malicious functions can be performed.They basically act as the infected computer .

6 0
3 years ago
Read 2 more answers
Piers wants to take a course on XML. He is a certified web designer,but he has not used XML before. How can he use XML to improv
Agata [3.3K]

Answer:

It will bring more verstality in his website. He will be able to define tags.

Explanation:

XML allows to define your own tags. You can bring semantics into your website which make data browsing easier.

3 0
3 years ago
Why is the OSI reference model useful?
sveticcg [70]
The answer to this question is B.

3 0
3 years ago
Which one of them are the correct answers?
Tpy6a [65]

Rapid prototyping! I am sure that is correct


6 0
3 years ago
Other questions:
  • Anna wants to open the Run dialog box to run her program file. Which keys should she press to open the Run dialog box?
    14·1 answer
  • Tell me about how to build robots
    11·1 answer
  • One metric ton is approximately 2,205 pounds.
    6·1 answer
  • The sequence of folders to a file or folder is called a(n) ________
    8·1 answer
  • Write the definition of a method printAttitude, which has an int parameter and returns nothing. The method prints a message to s
    8·1 answer
  • Jason is creating a web page for his school's basketball team. He just finished creating his storyboard. Which tool should he us
    6·2 answers
  • Identify the layout in which you will be able to view and edit the header and footer
    12·1 answer
  • Sequential codes may be used to represent complex items or events involving two or more pieces of related data.
    7·1 answer
  • Which of the following speeches is an example of a demonstration speech? a. “Who was Abraham Lincoln” b. “The Human Brain and it
    5·1 answer
  • Helpppppp me please cuz its due rn. put the correct word in the correct spot
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!