Question

Please write in Matlab. Thanks! Today you are going to pretend to be a detective working...

Please write in Matlab. Thanks!

Today you are going to pretend to be a detective working for an agency by interviewing suspects for a house robbery. The agency has obtained records of4 variables from 20 suspects and a number has been assigned to each suspect. This data is stored in a 20 by 5 matrix. You can download this matrix on blackboard and extract it form the file Problem5.mat. The format of the matrix is as follows:

Column 1: number assigned to the suspect
Column 2: height of each suspect (cm)
Column 3: weight of each suspect (kg)
Column 4: systolic blood pressure of each suspect (mmHg)Column 5: heart rate of each suspect (beats/min)

  1. The agency has a fuzzy street cam video of an intruder escaping from the house. From the video, it was deduced that the thief is roughly 150 to 180 cm tall, and weighs between 60 to 80 kg. Create a new matrix called suspects which includes the suspects who meet the above characteristics. Store each suspect’s number, weight and height in the matrix suspects. Also create a vector called notasuspect containing ONLY the suspect number of those who do not meet the mentioned characteristics. (Hint: you can use for and if statements)

  2. Tracesofadrugwerefoundattheincidentsite,suggestingthatthethiefmayhavehigh blood pressure. Edit the matrix suspects by deleting the all the information of the suspects whose blood pressure is lower than 120 mmHg. Add these deleted suspects to the notasuspect vector.

  3. The heart rates of the suspects were monitored and recorded for a key question in the interview process. Those with accelerated heart rate were considered dishonest. Edit matrix suspects by deleting the subjects with heart rate lower than 140 beats/min.

    There should only be two suspects left. Display the result in the following format:

    “The most likely to be the thief are suspect N and M.”
    ...where N and M are the assigned numbers of the two remaining suspects

    1   169   93   115   140
    2   196   81   126   77
    3   100   97   134   72
    4   151   73   108   86
    5   182   63   102   74
    6   161   72   117   61
    7   172   64   105   96
    8   129   93   109   189
    9   192   61   145   96
    10   172   85   118   77
    11   154   82   111   84
    12   114   93   138   81
    13   137   68   105   84
    14   168   95   137   70
    15   144   74   123   72
    16   143   90   130   61
    17   162   72   107   72
    18   151   96   135   69
    19   165   73   132   144
    20   160   66   122   172
0 0
Add a comment Improve this question Transcribed image text
Answer #1

% Read the 20 by 5 matrix
load -ASCII Problem5.mat;

% Create the matrix suspect
% Size of the Problem5 matrix
[m, n] = size(Problem5);

% Loop through each value in the matrix
j = 1;
k = 1;
for i = 1:m
% Check for the height is between 60 and 80
if (Problem5(i, 2)>=150 && Problem5(i, 2)<= 180)
% Check for the weights of the suspects
if (Problem5(i, 3)>=60 && Problem5(i, 3)<= 80)
% Add the suspect in suspect matrix
suspect(j, :) = Problem5(i, :);
j = j+1;
  
% Create notasuspect vector
else
notasuspect(k) = i;
k = k+1;
end
  
else
notasuspect(k) = i;
k = k+1;
end
end


% delete all the information of the suspects whose blood pressure is lower
% than 120
for i = 1:length(suspect)
% Check for blood pressure
if suspect(i, 4) < 120
% Add the same to notasuspect vector
notasuspect(k) = suspect(i, 1);
k = k+1;
suspect(i, :) = 0;
end
end

% Delete the rows from suspect
suspect(~any(suspect, 2), :) = [];


% delete suspects with heart rate lower than 140
for i = 1:size(suspect, 1)
% Check for heart rate
if suspect(i, 5)<140
% Add the same to notasuspect vector
notasuspect(k) = suspect(i, 1);
k = k+1;
suspect(i, :) = 0;
end
end

% Delete the rows from suspect
suspect(~any(suspect, 2), :) = [];


% Display the matrcies created
disp('The most likely to be the thief are suspects');
disp(suspect);
disp('Suspect Numbers of Persons of Not Suspects');
disp(notasuspect);

Screenshot of Output:

Add a comment
Know the answer?
Add Answer to:
Please write in Matlab. Thanks! Today you are going to pretend to be a detective working...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Consider the below matrixA, which you can copy and paste directly into Matlab.

    Problem #1: Consider the below matrix A, which you can copy and paste directly into Matlab. The matrix contains 3 columns. The first column consists of Test #1 marks, the second column is Test # 2 marks, and the third column is final exam marks for a large linear algebra course. Each row represents a particular student.A = [36 45 75 81 59 73 77 73 73 65 72 78 65 55 83 73 57 78 84 31 60 83...

  • Please show how you did this in excel. :13-19 Every home football game for the past...

    Please show how you did this in excel. :13-19 Every home football game for the past eight years at Eastern State University has been sold out. The revenues from ticket sales are significant, but the sale of food, beverages, and souvenirs has contrib- uted greatly to the overall profitability of the football program. One particular souvenir is the football pro- gram for each game. The number of programs sold at each game is described by the following probabil- ity distribution:...

  • Write a Java program, In this project, you are going to build a max-heap using array...

    Write a Java program, In this project, you are going to build a max-heap using array representation. In particular, your program should: • Implement two methods of building a max-heap. o Using sequential insertions (its time complexity: ?(?????), by successively applying the regular add method). o Using the optimal method (its time complexity: ?(?), the “smart” way we learned in class). For both methods, your implementations need to keep track of how many swaps (swapping parent and child) are required...

  • Please help me with the problem 4.7! The reference problem 1.20 is attached, and the data...

    Please help me with the problem 4.7! The reference problem 1.20 is attached, and the data is the full data in question 1.20. Thanks! 20 2 60 4 46 3 41 2 12 1 137 10 68 5 89 5 4 1 32 2 144 9 156 10 93 6 36 3 72 4 100 8 105 7 131 8 127 10 57 4 66 5 101 7 109 7 74 5 134 9 112 7 18 2 73 5...

  • == Programming Assignment == For this assignment you will write a program that controls a set...

    == Programming Assignment == For this assignment you will write a program that controls a set of rovers and sends them commands to navigate on the Martian surface where they take samples. Each rover performs several missions and each mission follows the same sequence: deploy, perform one or more moves and scans, then return to base and report the results. While on a mission each rover needs to remember the scan results, in the same order as they were taken,...

  • 2. Using the data set of the Health Exam Results, conduct the following analysis between the variables of weight (WT) and Body Mass Index (BMI). Number the data set from 1 to 40, and select the...

    2. Using the data set of the Health Exam Results, conduct the following analysis between the variables of weight (WT) and Body Mass Index (BMI). Number the data set from 1 to 40, and select the following individuals: . Set 1 (Malo): 1, 5, 10, 13, 15, 18, 19, 24, 29, 31, 32, 33 .Set 2 (Fomalo): 4, 9, 15, 16, 17, 22, 23, 29, 33, 37, 38, 40 Draw a scatter diagram of the sample of 12 data set...

  • Please help with problem 8-56 and 8-57. Thank you!!! 8-56 106 Assume you are planning the...

    Please help with problem 8-56 and 8-57. Thank you!!! 8-56 106 Assume you are planning the confirmation of accounts receivable. There are 2,000 customer accounts with a total book! value of $5,643,200. Tolerable misstatement is set at $200,000, and expected misstatement is $40,000. The risk of incorrect accep- tance is 30%. The ratio of expected to tolerable misstatement is 20%, and the ratio of tolerable misstatement to the population is 3.5% (round down to 3% for use in Exhibit 8.7)...

  • You are the manager of a company that owns several outpatient surgery facilities. You want to...

    You are the manager of a company that owns several outpatient surgery facilities. You want to determine if there are differences in overall patient health as measured by the General Health Status Score (GHSS) by type of patient carrier (Government, Insured, Uninsured). Your IT department provided you data on patient visits by type of carrier and the GHSS. Prepare a report to share with the owners of the facility that will help you make informed decisions about whether or not...

  • Please determine the IDENTITY of the unknown compound and explain how each peak / data point...

    Please determine the IDENTITY of the unknown compound and explain how each peak / data point from the following instruments led to that identification. What does the gcms indicate. Thank you very much! (The GCMS data is just a long set of numbers which is why the question appears so long). IR of unknown: NMR unknown Proton Graphs (first is overall graph, others that follow are zoomed in sections): NMR unknown Carbon Graphs (first is overall graph, others that follow...

  • Problem #1: TO SELECT THE MOST ECONOMICAL Wio SHAPE COLUMN ZO FEET IN HEIGHT SUPPORT AH...

    Problem #1: TO SELECT THE MOST ECONOMICAL Wio SHAPE COLUMN ZO FEET IN HEIGHT SUPPORT AH AXIAL LORD OF 370 KIPS using soksi STEEL! ASSUME A FIXED BASE ANDA PINGED TOP (CASE C) WIDE FLANGE SHAPES HP Axis Y-Y Theoretical Dimensions and Properties for Designing Flange Axis X-X | Weight Area Depth Web Section per of of Thick- Thick- Number Foot Section Section Width S 'T Sy Ty ness ness < * A by tw in. in. in.' in. in....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT