Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Inputs: 1. (char) A 1x(6*N) vector of Olympic events 2. (logical) A 1xN vector of whether or not the athlete competes in the event Outputs:

Inputs:

1. (char) A 1x(6*N) vector of Olympic events 2. (logical) A 1xN vector of whether or not the athlete competes in the event

Outputs:

  1. (char) A 1xP vector of the Olympic events that the athlete doesn't compete in

  2. (double) A 1xM vector of the original positions of the events the athlete competes in

Background:

You just started working for the Olympic Committee and on your first day the system mixed up what events different athletes compete in. As MATLAB is your specialty, you've been tasked with determining the correct events for a certain athlete! Fix the Summer Olympics!

Function Description:

Given a list of the first 5 letters of different Olympic events and a logical vector of whether the athlete competes in that event, output the events that should not be included in the athlete's event list. You should also output a vector of the positions of the events that belong in ascending order.

Example:

events = 'TRACK SWIMM DIVIN FENCI ' belong = [true true] [wrong, positions] = eventList(events, belong) wrong 'CYCLI BOXIN '

positions [1 3 5 6]

Notes:

  • Event names will always be five capital letters followed by a space, both in the input and output.

  • You will not be given a test case with no falses in the logical input vector.

    Hints:

  • Think about how you can create a mask the same size as the string input.

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

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions

Question

How did you feel about taking piano lessons as a child? (general)

Answered: 1 week ago