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
President Roosevelt's Fireside Chats were:
larisa86 [58]
C. Entertaining radio shows that families listened to in the evening. He did these chats to inform the public on what he was going to do about the problems facing the public.
3 0
2 years ago
Read 2 more answers
Q.drtrdyudoijoemrkdf
sveta [45]

Answer:

Yes

Explanation:

8 0
2 years ago
Read 2 more answers
A hacker using information gathered from sniffing network traffic uses your banking credentials from a recent transaction to cre
adell [148]

Answer: a replay attack, a replay attack is used so that the attacker can go sniff out the hash, and get whatever they are trying to get, then once it goes to the attacker it will go back to the original connection after replaying the hash

3 0
2 years ago
Make sure to read all of these specifications carefully. Write a function, named array_shifter, that accepts an array of doubles
rosijanka [135]

Answer:

import java.util.Arrays;

public class num2 {

   public static void main(String[] args) {

//Create and initialize the first array        

double [ ]arr = {3.5, 5.6, 4.5, 6.7};

// Get the length of the array

       int n = arr.length;

      //Call the method Array Shifter inside the output statement

       System.out.println(Arrays.toString(array_shifter(arr,n)));

   }

   static double [] array_shifter(double [ ] doubleArray, int n){

       double [] narr = new double[n+1];

       //Loop through from index 1

       for(int i =0; i<narr.length-1; i++){

           narr[i] = doubleArray[i];

       }

       //Put a new element at the last index

       narr[narr.length-1] = 1.1;

       return narr;

   }

}

Explanation:

This is implemented in Java

Read detailed comments in the solution

The method array_shifter creates a new array that is one element larger than the array it received as argument and returns it

6 0
3 years ago
IS ANYONE ELSE JUST GETTING PPL PUTTING LINKS WHEN U ASK A QUESTION???
TiliK225 [7]
UGH IKR, LIKE JUST ANSWER THE FRICKIN QUESTION
4 0
2 years ago
Read 2 more answers
Other questions:
  • What is the maximum number of colors that should be used on a slide?
    5·2 answers
  • To play game, go inside the Grand Theft Auto V folder and right click and runGTAVLauncher as administrator.If you get any missin
    5·1 answer
  • Jump to Question: Fill in the blanks below: The flow of electricty is similar to the movement of water through a pipe. The movem
    15·1 answer
  • When a communication exchange that does not verify the identity of the endpoints of a communication and accepts any properly for
    10·1 answer
  • Which of the following would an interactive media professional most likely need? A.a high school diploma
    15·1 answer
  • Next, Leah wants to add a content slide that allows her to insert a table.
    8·2 answers
  • The individual accountable for ensuring the day-to-day operation of the InfoSec program, accomplishing the objectives identified
    7·1 answer
  • Cómo fue posible que los alemanes exterminando seres humanos​
    11·1 answer
  • AfcAAgrwdsgsFsefvzsdfvbjhbdjbbjbjsdndVHFadbhZJBVdb
    10·2 answers
  • Radio spectrum is the part of the complete range of electromagnetic waves that is used for radio communication from
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!