Question

Challenge 11.4.2: Finding a substring: Guest list Activity This activity uses a 3rd party app. Though your activity may be recorded, a refresh may be required to update the banner to the left. Finding a substring: Guest list Assign o with 1 if guestName is included on guestList. Otherwise, assign onList with 0. Note: The isempty(A) function returns a logical 1 (true) if array A is empty and logical 0 (false) otherwise Ex: If guestName is Benjamin and guestList is Harold Delphia Benjamin Lovie Ena, then onList is 1 Your Solution Save C Reset M MATLAB Documentation 1 function onList Find Guest (guestName, guestList) on List 0; 3 end Run Your Solution Code to call your function when you click Run C Reset 1 Find Guest Benjamin Harold Delphia Benjamin Lovie Ena 2 Find Guest Benjamin Harold Delphia Benjamin Lovie Ena returns 1 3 Find Guest Madeline Harold Delphia Benjamin Lovie Ena returns 0 Submit for Assessment Run

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Function onList = FindGuest(guestName,guestList)

k = findstr(guestName,guestList)

if isempty(k)==0

onList=1

else

onList =0

  

Add a comment
Know the answer?
Add Answer to:
Assign onList with 1 if guestName is include on guestList. Otherwise, assign onList with 0. If...
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
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