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
A survey of results on mobile phone datasets analysis
xxMikexx [17]
PErfect! 100% Absolutely beautiful. 
6 0
3 years ago
____________________ memory is the ability to add RAM without shutting down the computer or operating system.
Liula [17]

Answer:

Hot-add

Explanation:

The computer system is a electronic device that is used to perform computational task on input data for a pre-dertermined result. The components of the computer is divided into hardware and software components.

The hardware components are the physical parts of the computer system, while the software component are the instructions that runs the system.

The RAM is a physical component that provides memory for running current activities on the monitor screen. When it is removed or faulty, the screen goes blank. To add more RAM memory to the system while the system is on, activate the hot-add memory settings.

4 0
3 years ago
9.10: Reverse ArrayWrite a function that accepts an int array and the array ’s size as arguments . The function should create a
AleksandrR [38]

Answer:

#include <iostream>

using namespace std;

int * reverse(int a[],int n)//function to reverse the array.

{

   int i;

   for(i=0;i<n/2;i++)

   {

       int temp=a[i];

       a[i]=a[n-i-1];

       a[n-i-1]=temp;

   }

   return a;//return pointer to the array.

}

int main() {

   int array[50],* arr,N;//declaring three variables.

   cin>>N;//taking input of size..

   if(N>50||N<0)//if size greater than 50 or less than 0 then terminating the program..

   return 0;

   for(int i=0;i<N;i++)

   {

       cin>>array[i];//prompting array elements..

   }

   arr=reverse(array,N);//function call.

   for(int i=0;i<N;i++)

   cout<<arr[i]<<endl;//printing reversed array..

   cout<<endl;

return 0;

}

Output:-

5

4 5 6 7 8

8

7

6

5

4

Explanation:

I have created a function reverse which reverses the array and returns pointer to an array.I have also considered edge cases where the function terminates if the value of the N(size) is greater than 50 or less than 0.

8 0
3 years ago
Your data warehousing project group is debating whether to create a prototype of a data warehouse before its implementation. The
Dvinal [7]

Answer:

Hmmm, what would i recommand i think you Should learn skills and become innovative  

Explanation:

Sir i'm gonna go toilet and come back

7 0
2 years ago
Which of the following was the most significant impact the NEA had on the performing arts industry? W
Sedaia [141]

Answer:

The NEA’s focus on building new performing arts centers led to an increased production of arts.

5 0
3 years ago
Other questions:
  • What operating system was most commonly used by early personal computers? Apple Mac MS-DOS Windows
    6·2 answers
  • Please help!
    6·2 answers
  • You've formatted the first paragraph of a document. What button can you use to apply the formatting from the first paragraph to
    9·2 answers
  • The identification of critical information is a key part of the OPSEC process because: a) It is required by the JTF commander to
    13·1 answer
  • Electromagnetic waves used in ovens and cell phone communications are called
    6·1 answer
  • Discuss the pros and cons of tombstoning versus multitasking. Why do you think Microsoft chose tombstoning?
    11·1 answer
  • Python code 100 Random Numbers (twice)
    9·1 answer
  • What form of contacts can be shared in Outlook 2016?
    9·2 answers
  • Does analogue conversation take place in source as transmitter?
    5·2 answers
  • Which of the following was the first computer-animated film to win animated film to win an academy award?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!