Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Problem 213. Create a dictionary

Created by Arthur Goldsipe

The goal is to write a function that returns a dictionary from a list of words or phrases and their definitions. Here is an example:

>> words = {'do', 're', 'mi'};
>> definitions = {'a deer', 'a drop of golden sun', 'a name I call myself'};
>> dictionary = createDictionary(words, definitions);
>> dictionary('mi')
ans =
a name I call myself

The first and second arguments will always be cell strings but can contain any characters. The output must be a function handle.

Tags

Problem Group

Solution Statistics

32 correct solutions 63 incorrect solutions
Last solution submitted on Sep 15, 2014

Problem Comments