File Exchange Pick of the Week

Our best user submissions

Yankee Swap 2

Posted by Sean de Wolski,

Sean‘s pick this week is Yankee Swap by Heather Gorr.

As the end of the year approaches, many of you will likely be summonsed to partake in Yankee Swaps with your coworkers. This app can help you organize the chaos!

All you need to do is provide a folder with labeled mug shots of the participants and the app will do the rest. If you need help labeling images, look at the imageLabeler app!

Below, my colleague’s and my dogs will play. I used a random seed of 56 for reproducibility and we’re on our way.

Lexi starts off:

Ranger is next; he steals the squeaky snake sending Lexi back to the pile.

Ember steals the bully stick and Lexi gets stuck with booties…

Lilly, after some tugging, steals the squeaky from Ranger who steals the bully stick from Ember where she goes back to the pile and pulls out a knuckle bone.

Kenai, being just 13 weeks old, wants whatever Ember who then opens a boring LED collar.

Berber lucks out and starts the final round which sees three thefts, of just the edible treats. Mya ends up stuck with a free bath which she kind of needs.


The additional rule we play with in MathWorks Application Engineering is that each gift can only be swapped three times before it’s safe. That allows us engineers to further strategize how to secure the six pack instead of the MATLAB membrane socks. Of course, Kenai really wants me to pick those.


Have a great holiday season and new year!

Give it a try and let us know what you think here or leave a comment for Heather.

Get the MATLAB code

Published with MATLAB® R2018b


Comments are closed.

2 CommentsOldest to Newest

Sean de Wolski replied on : 2 of 2
Hi Ryan, Those were a novelty thing at one of our Winter Celebrations a few years ago. I checked with fulfillment and unfortunately they don't have any more (which I guess increases the value of existing pairs?!).