Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

matlab, no conditionals please Function Name: setThief I. 2. 3. 4. (logica) Vector of suspect #1's answers to a lie detector (logical) Vector of suspect

image text in transcribedmatlab, no conditionals please

Function Name: setThief I. 2. 3. 4. (logica) Vector of suspect #1's answers to a lie detector (logical) Vector of suspect #2's answers to a lie detector (logical) Vector of suspect #3's answers to a lie detector (logical) Vector of suspect #4's answers to a lie detector Outputs 1. (char) Sentence stating which suspect stole the set list Banned Functions isequal (), isequaln(), strcmp(), strcmpi() Background: You are the manager for the headliner at a music festival, and there's been an incident: someone stole and leaked the set list. The band is not happy, and it's up to you to bring justice to the thief. You have identified four suspects, and given them a lie detector test. You know that each suspect who is telling the truth will have matching answers. However, the thief will having at least one answer that is different from the rest. You have decided to use your new MATLAB skills to find the true thief Function Description Each input to the function is a logical vector corresponding to the answers a suspect gives on the lie detector. Each element of the vectors represent a different question. Three of the suspects will have the exact same answers, but one suspect's answers will be slightly-or completely-different than the others' answers. Using your knowledge of logical indexing and masking, determine which of the four suspects is lying, and thus, is the set list thief The output string will be of the form 'Suspect # corresponds to the suspect number who stole the set list. The number is determined by the input order Notes: . The suspect who lied (the one who leaked the set list), will have at least one answer that is different from the other suspects' answers, but could differ up to every answer You may not use the isequal() function to code this problem. Use of the isequal() function will result in zero credit for this problem. However, the use of isequal() to check that your output matches the solution outputs is encouraged The output string ends with a period. Do not forget that period! . . Function Name: setThief I. 2. 3. 4. (logica) Vector of suspect #1's answers to a lie detector (logical) Vector of suspect #2's answers to a lie detector (logical) Vector of suspect #3's answers to a lie detector (logical) Vector of suspect #4's answers to a lie detector Outputs 1. (char) Sentence stating which suspect stole the set list Banned Functions isequal (), isequaln(), strcmp(), strcmpi() Background: You are the manager for the headliner at a music festival, and there's been an incident: someone stole and leaked the set list. The band is not happy, and it's up to you to bring justice to the thief. You have identified four suspects, and given them a lie detector test. You know that each suspect who is telling the truth will have matching answers. However, the thief will having at least one answer that is different from the rest. You have decided to use your new MATLAB skills to find the true thief Function Description Each input to the function is a logical vector corresponding to the answers a suspect gives on the lie detector. Each element of the vectors represent a different question. Three of the suspects will have the exact same answers, but one suspect's answers will be slightly-or completely-different than the others' answers. Using your knowledge of logical indexing and masking, determine which of the four suspects is lying, and thus, is the set list thief The output string will be of the form 'Suspect # corresponds to the suspect number who stole the set list. The number is determined by the input order Notes: . The suspect who lied (the one who leaked the set list), will have at least one answer that is different from the other suspects' answers, but could differ up to every answer You may not use the isequal() function to code this problem. Use of the isequal() function will result in zero credit for this problem. However, the use of isequal() to check that your output matches the solution outputs is encouraged The output string ends with a period. Do not forget that period

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions