Question: Using MATLAB Homework 4 - Logicals and Masking Extra Credit Function Name: smashBallThief Inputs 1. 2 3 4, (logical) Vector of suspect #1's answers to

Using MATLAB Homework 4 - Logicals and Masking Extra Credit Function Name:Using MATLAB

Homework 4 - Logicals and Masking Extra Credit Function Name: smashBallThief Inputs 1. 2" 3" 4, (logical) 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 smash ball Banned Functions isequal (), isequaln(), strcmp(), strcmpi() Background You are playing in your dorm's Super Smash Bros Ultimate tournament. The stakes are high, and you know your friends would stop at nothing to be the champion. That's when you notice that the Smash Ball has gone missing! You have identified four suspects and given themm 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 Smash Ball Thief! The output string will be of the form 'Suspect #num stole the Smash Ball!' where 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 stole the Smash Bal 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!