MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

# Solution 321337

Submitted on 19 Sep 2013 by Tim

Correct

69Size
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test
Code Input and Output
1
Pass

%%
tic
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

2
Pass

%%
names={{'Dr_Evil' 'Devastation'} {'Dr_Evil' 'Southpaw'} {'Dr_Evil' 'Lagomorph'} {'Dr_Evil' 'Rampage'} {'Dr_Evil' 'Unicron'} {'Dr_Evil' 'Magenta'} {'Dr_Evil' 'Silver_Swan'} {'Dr_Evil' 'Zaladane'} {'Dr_Evil' 'Jason_Kreis'} {'Dr_Evil' 'Lotso'} };
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

3
Pass

%%
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

4
Pass

%%
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

5
Pass

%%
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

6
Pass

%%
names={{'Princess_Python' 'Abominatrix'} {'Mai_Shen' 'Devastation'} {'Abominatrix' 'Mai_Shen'} {'Devastation' 'Princess_Python'} };
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

7
Pass

%%
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

8
Pass

%%
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

9
Pass

%%
names={{'Silk_Fever' 'Mothergod'} {'Decay' 'Shimmer'} {'Golden_Glider' 'Windfall'} {'Silver_Banshee' 'Queen_Of_Fables'} {'Typhoid_Mary' 'Syndrome'} {'Unicron' 'Maxima'} {'Lady_Vic' 'Lady_Octopus'} {'Golden_Glider' 'Zaladane'} {'Typhoid_Mary' 'Harley_Quinn'} {'Silver_Banshee' 'Mothergod'} {'Osira' 'Lotso'} {'Queen_Bee' 'Tala'} {'Spider_Girl' 'Zaladane'} {'Silk_Fever' 'King_Ghidorah'} {'Typhoid_Mary' 'Lotso'} {'Osira' 'Mothergod'} {'Spider_Girl' 'Syndrome'} {'Star_Sapphire' 'Syndrome'} {'Saturn_Queen' 'Sun_Girl'} {'Bombshell' 'Lotso'} {'Lady_Vic' 'Shimmer'} {'Livewire' 'Tala'} {'Bombshell' 'Maxima'} {'Golden_Glider' 'Tala'} {'Silver_Banshee' 'Shiv'} {'Queen_Clea' 'Tala'} {'Spider_Girl' 'Lotso'} {'Bombshell' 'Eviless'} {'Decay' 'Maxima'} {'Golden_Glider' 'Mothergod'} {'Devastation' 'Mai_Shen'} {'Spider_Girl' 'New_Wave'} {'Saturn_Queen' 'Queen_Of_Fables'} {'Osira' 'Harley_Quinn'} {'Osira' 'Maxima'} {'Scandal' 'Maxima'} {'Livewire' 'Eviless'} {'Deuce' 'Zaladane'} {'Deuce' 'Maxima'} {'Queen_Clea' 'Mothergod'} {'Unicron' 'Evinlea'} {'Deuce' 'Tala'} {'Devastation' 'Superwoman'} {'Livewire' 'Shimmer'} {'Scandal' 'King_Ghidorah'} {'Typhoid_Mary' 'King_Ghidorah'} {'Bombshell' 'Evinlea'} {'Star_Sapphire' 'Lady_Octopus'} {'Spider_Girl' 'Evinlea'} {'Coachwhip' 'New_Wave'} {'Star_Sapphire' 'Zaladane'} {'Devastation' 'Shiv'} {'Queen_Bee' 'Lady_Octopus'} {'Decay' 'New_Wave'} {'Scandal' 'Superwoman'} {'Unicron' 'Zaladane'} {'Decay' 'King_Ghidorah'} {'Typhoid_Mary' 'Maxima'} {'Dansen_Macabre' 'Evinlea'} {'Queen_Clea' 'Maxima'} {'Queen_Clea' 'Superwoman'} {'Deuce' 'Queen_Of_Fables'} {'Decay' 'Sun_Girl'} {'Golden_Glider' 'Sun_Girl'} {'Star_Sapphire' 'Eviless'} {'Silk_Fever' 'Lazara'} {'Lady_Vic' 'Sun_Girl'} {'Unicron' 'New_Wave'} {'Saturn_Queen' 'King_Ghidorah'} {'Unicron' 'Lotso'} {'Silver_Banshee' 'King_Ghidorah'} {'Golden_Glider' 'Superwoman'} {'Decay' 'Tala'} {'Devastation' 'Tala'} {'Dansen_Macabre' 'Maxima'} {'Dansen_Macabre' 'Lady_Octopus'} {'Silver_Banshee' 'Mai_Shen'} {'Silver_Banshee' 'Lazara'} {'Spider_Girl' 'Mothergod'} {'Deuce' 'Syndrome'} {'Dansen_Macabre' 'Windfall'} {'Bombshell' 'Lady_Octopus'} {'Silk_Fever' 'Zaladane'} {'Scandal' 'Syndrome'} {'Livewire' 'Windfall'} {'Decay' 'Harley_Quinn'} {'Scandal' 'New_Wave'} {'Osira' 'Eviless'} {'Dansen_Macabre' 'Shimmer'} {'Saturn_Queen' 'Lady_Octopus'} {'Queen_Clea' 'Shiv'} {'Decay' 'Shiv'} {'Scandal' 'Shimmer'} {'Coachwhip' 'Tala'} {'Osira' 'Evinlea'} {'Silk_Fever' 'Evinlea'} {'Coachwhip' 'Queen_Of_Fables'} {'Deuce' 'Evinlea'} {'Bombshell' 'Lazara'} {'Lady_Vic' 'Queen_Of_Fables'} };
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

10
Pass

%%
names={{'Spider_Girl' 'Blue_Snowman'} {'Blue_Snowman' 'Roulette'} {'Roulette' 'Spider_Girl'} };
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

11
Pass

%%
names={{'Rampage' 'Fury_Leika'} {'Tigress' 'Princess_Python'} {'Syndrome' 'Animora'} {'Maxima' 'Prank'} {'Queen_Of_Fables' 'Queen_Bee'} {'Queen_Of_Fables' 'Doctor_Cyber'} {'Magpie' 'Queen_Bee'} {'Shimmer' 'Golddigger'} {'Rampage' 'Queen_Clea'} {'Magpie' 'Abominatrix'} {'Maxima' 'Titania'} {'Tigress' 'Prank'} {'Decay' 'Prank'} {'Spider_Girl' 'Jewelee'} {'Magpie' 'Princess_Python'} {'Eviless' 'Abominatrix'} {'Shimmer' 'Doctor_Cyber'} {'Star_Sapphire' 'Animora'} {'Star_Sapphire' 'Jinx'} {'Yellowjacket' 'Blue_Snowman'} {'Star_Sapphire' 'Queen_Clea'} {'Black_Mamba' 'Jewelee'} {'Star_Sapphire' 'Blue_Snowman'} {'Magpie' 'Titania'} {'Spider_Girl' 'Abominatrix'} {'Lashina' 'Dr_Evil'} {'Margaret_Love' 'Prank'} {'Lotso' 'Fury_Leika'} {'Maxima' 'Abominatrix'} {'Decay' 'Queen_Clea'} {'Star_Sapphire' 'Doctor_Cyber'} {'Maxima' 'Queen_Clea'} {'Yellowjacket' 'Abominatrix'} {'Syndrome' 'Sun_Girl'} {'Rampage' 'Windfall'} {'Lotso' 'Titania'} {'Syndrome' 'Blue_Snowman'} {'Plastique' 'Queen_Clea'} {'Magpie' 'Sun_Girl'} {'Lady_Clay' 'Queen_Clea'} {'Eviless' 'Princess_Python'} {'Fake_Thomas_Jefferson' 'Blue_Snowman'} {'Rampage' 'Animora'} {'Fake_Thomas_Jefferson' 'Sun_Girl'} {'Star_Sapphire' 'Abominatrix'} {'Black_Mamba' 'Poundcakes'} {'Plastique' 'Sun_Girl'} {'Lady_Clay' 'Titania'} {'Fake_Thomas_Jefferson' 'Windfall'} {'Shimmer' 'Osira'} {'Lady_Clay' 'Ursa'} {'Syndrome' 'Queen_Bee'} {'Maxima' 'Blue_Snowman'} {'Lady_Clay' 'Dr_Evil'} {'Decay' 'Amy_Madison'} {'Tigress' 'Jinx'} {'Spider_Girl' 'Jinx'} {'Margaret_Love' 'Titania'} {'Star_Sapphire' 'Poundcakes'} {'Plastique' 'Doctor_Cyber'} {'Black_Mamba' 'Amy_Madison'} {'Tigress' 'Titania'} {'Lashina' 'Golddigger'} {'Eviless' 'Dr_Evil'} {'Magenta' 'Windfall'} {'Yellowjacket' 'Princess_Python'} {'Syndrome' 'Prank'} {'Shimmer' 'Poundcakes'} {'Decay' 'Fury_Leika'} {'Decay' 'Windfall'} {'Black_Mamba' 'Golddigger'} {'Rampage' 'Abominatrix'} {'Syndrome' 'Golddigger'} {'Maxima' 'Fury_Leika'} {'Eviless' 'Jewelee'} {'Lashina' 'Blue_Snowman'} {'Lady_Clay' 'Jinx'} {'Lady_Clay' 'Windfall'} {'Magpie' 'Ursa'} {'Eviless' 'Prank'} {'Tigress' 'Abominatrix'} {'Star_Sapphire' 'Eviless'} {'Tigress' 'Fury_Leika'} {'Magenta' 'Ursa'} {'Yellowjacket' 'Jewelee'} {'Yellowjacket' 'Ursa'} {'Plastique' 'Osira'} {'Tigress' 'Sun_Girl'} {'Tigress' 'Golddigger'} {'Spider_Girl' 'Windfall'} {'Fake_Thomas_Jefferson' 'Amy_Madison'} {'Magenta' 'Fury_Leika'} {'Star_Sapphire' 'Amy_Madison'} {'Magenta' 'Blue_Snowman'} {'Plastique' 'Ursa'} {'Fake_Thomas_Jefferson' 'Abominatrix'} {'Lotso' 'Jewelee'} {'Lotso' 'Jinx'} {'Maxima' 'Animora'} {'Magenta' 'Sun_Girl'} };
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

12
Pass

%%
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

13
Pass

%%
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

14
Pass

%%
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

15
Pass

%%
names={{'Snapdragon' 'Fake_Thomas_Jefferson'} {'Mephista' 'Dr_Horrible'} {'Mephista' 'Queen_Bee'} {'Duela_Dent' 'Fake_Thomas_Jefferson'} {'Blue_Snowman' 'Leather'} {'Poundcakes' 'Ursa'} {'Typhoid_Mary' 'Star_Sapphire'} {'Eviless' 'Ursa'} {'Trinity' 'Mothergod'} {'Blue_Snowman' 'Mai_Shen'} {'Duela_Dent' 'Queen_Bee'} {'Snapdragon' 'The_Lightning'} {'Eviless' 'Mothergod'} {'Gru' 'Bombshell'} {'Blue_Snowman' 'Evinlea'} {'Mephista' 'Jinx'} {'Snapdragon' 'Mai_Shen'} {'Devastation' 'Dr_Horrible'} {'Trinity' 'Ingra'} {'Titania' 'Queen_Bee'} {'Snapdragon' 'Valentina'} {'Eviless' 'Queen_Clea'} {'Gru' 'Professor_Padraic_Ratigan'} {'Blue_Snowman' 'Jinx'} {'Gru' 'Lafety_Le_Fei'} {'Roulette' 'Ursa'} {'Lady_Vic' 'Star_Sapphire'} {'Emerald_Empress' 'Bombshell'} {'Devastation' 'Mai_Shen'} {'Mephista' 'Lafety_Le_Fei'} {'Eviless' 'Fem_Paragon'} {'Blue_Snowman' 'Unicron'} {'Snapdragon' 'Lafety_Le_Fei'} {'Emerald_Empress' 'Mothergod'} {'Typhoid_Mary' 'Valentina'} {'Plastique' 'Jinx'} {'Gru' 'Leather'} {'Dead_Bowie' 'Leather'} {'Lady_Vic' 'The_Lightning'} {'Trinity' 'Margaret_Love'} {'Emerald_Empress' 'Queen_Clea'} {'Typhoid_Mary' 'Lafety_Le_Fei'} {'Devastation' 'Leather'} {'Titania' 'Lafety_Le_Fei'} {'Sun_Girl' 'Bombshell'} {'Dead_Bowie' 'Ursa'} {'Blue_Snowman' 'Queen_Clea'} {'Lady_Vic' 'Ursa'} {'Devastation' 'Professor_Padraic_Ratigan'} {'Gru' 'The_Lightning'} {'Superwoman' 'Mothergod'} {'Poundcakes' 'Ingra'} {'Trinity' 'The_Lightning'} {'Jason_Kreis' 'Fem_Paragon'} {'Lady_Vic' 'Mai_Shen'} {'New_Wave' 'Evinlea'} {'Gru' 'Typhoid_Mary'} {'Gru' 'Valentina'} {'Superwoman' 'Fem_Paragon'} {'Roulette' 'Queen_Bee'} {'Plastique' 'Dr_Horrible'} {'New_Wave' 'Fem_Paragon'} {'Trinity' 'Fem_Paragon'} {'Blue_Snowman' 'The_Lightning'} {'Duela_Dent' 'Unicron'} {'New_Wave' 'Mothergod'} {'Trinity' 'Bombshell'} {'Blue_Snowman' 'Valentina'} {'Gru' 'Ursa'} {'Roulette' 'Mothergod'} {'Gru' 'Mothergod'} {'Sun_Girl' 'Star_Sapphire'} {'Roulette' 'Unicron'} {'Mephista' 'Leather'} {'Devastation' 'Ursa'} {'Devastation' 'Mothergod'} {'Dead_Bowie' 'Margaret_Love'} {'Superwoman' 'Lafety_Le_Fei'} {'Eviless' 'Dr_Horrible'} {'Superwoman' 'Leather'} {'Devastation' 'Ingra'} {'Poundcakes' 'Evinlea'} {'Typhoid_Mary' 'Queen_Clea'} {'Eviless' 'Evinlea'} {'Jason_Kreis' 'Fake_Thomas_Jefferson'} {'Jason_Kreis' 'Professor_Padraic_Ratigan'} {'Superwoman' 'Professor_Padraic_Ratigan'} {'Typhoid_Mary' 'Unicron'} {'New_Wave' 'Leather'} {'Dead_Bowie' 'Jinx'} {'Titania' 'Bombshell'} {'Gru' 'Fake_Thomas_Jefferson'} {'Typhoid_Mary' 'Queen_Bee'} {'Duela_Dent' 'Bombshell'} {'Trinity' 'Jinx'} {'Sun_Girl' 'Jinx'} {'Eviless' 'Fake_Thomas_Jefferson'} {'Titania' 'The_Lightning'} {'Snapdragon' 'Margaret_Love'} {'Plastique' 'Leather'} };
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

16
Pass

%%
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

17
Pass

%%
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

18
Pass

%%
names={{'Magpie' 'Blue_Snowman'} {'Magpie' 'Lafety_Le_Fei'} {'Magpie' 'Lady_Quark'} {'Magpie' 'Lady_Shiva'} {'Magpie' 'The_Crimson_Ghost'} {'Magpie' 'Purgatori'} {'Magpie' 'Titania'} {'Magpie' 'Nyssa_Raatko'} {'Magpie' 'Mephista'} };
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

19
Pass

%%
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

20
Pass

%%
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

21
Pass

%%
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

22
Pass

%%
names={{'Genevieve_Savidge' 'Queen_Of_Fables'} {'Genevieve_Savidge' 'Spider_Girl'} {'Gru' 'Trinity'} {'Genevieve_Savidge' 'Trinity'} {'Gru' 'Spider_Girl'} {'Unicron' 'Queen_Of_Fables'} {'Unicron' 'Trinity'} {'Unicron' 'Spider_Girl'} {'Gru' 'Queen_Of_Fables'} };
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

23
Pass

%%
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

24
Pass

%%
names={{'The_Lightning' 'Saturn_Queen'} {'The_Lightning' 'Tigress'} {'Princess_Python' 'Superwoman'} {'Princess_Python' 'Tigress'} {'The_Lightning' 'Black_Mamba'} {'The_Lightning' 'Osira'} {'Princess_Python' 'Osira'} {'Princess_Python' 'Saturn_Queen'} {'Princess_Python' 'Black_Mamba'} {'The_Lightning' 'Superwoman'} };
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

25
Pass

%%
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

26
Pass

%%
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

27
Pass

%%
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

28
Pass

%%
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

29
Pass

%%
names={{'Mai_Shen' 'Windfall'} {'Syndrome' 'Queen_Bee'} {'Dr_Horrible' 'Mai_Shen'} {'Windfall' 'Animora'} {'New_Wave' 'Dr_Horrible'} {'Animora' 'Syndrome'} {'Queen_Bee' 'New_Wave'} };
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

30
Pass

%%
exp=1;
TF=Make_Teams(names);
assert(TF==exp)

31
Pass

%%
exp=0;
TF=Make_Teams(names);
assert(TF==exp)

32
Pass

%%
names={{'Mephista' 'Mothergod'} };
exp=1;
TF=Make_Teams(names);
assert(TF==exp)
toc
Elapsed time is 0.363828 seconds.