Create a dictionary - MATLAB Cody - MATLAB Central

Problem 213. Create a dictionary

Difficulty:Rate

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.

Solution Stats

30.0% Correct | 70.0% Incorrect
Last Solution submitted on May 14, 2025

Problem Comments

Solution Comments

Show comments
Why should you share code?
In a discussion on LInkedin about my recent blog post, Do these...
2
3

Problem Recent Solvers78

Suggested Problems

More from this Author1

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!