Due: before Class 13 (i.e., Feb 21, 2pm)
This is an individual assignment, i.e., you will be assessed as an individual. Your goal is to write a MATLAB
code that can translate ‘Morse code’ to English and show the letter percentage in a component pie-chart.
The conversion chart is provided:
code =[“.—-“;“..—“;“…–“;“….-“;“…..”;“-….”;“–…”;“—..”;“—
;“-.–“;“–..”; “..–.-“];
An example:
Original Morse code: “-.-./—/…-/../-../.—-/—-./..–.- /.–./.-/-./-.././–/../-.-./..–.- /…-/.-/-.-./-.-./../-././”
Expected outcome from your code:
The function you will need for the pie-chart plot: pie() or pie3().

A single ZIP or RAR file containing all the .m or .mlx files required to run your code
. Your main
script file should be named “YourName.m” or “YourName.mlx”.
Code is expected to run without error.
If we cannot run your code, your evaluation score will be 0,
regardless of how well everything is done.
We will put all .m and .mlx files that you provide into a single
directory. We will execute your code by opening the YourName.m or YourName.mlx file and clicking the
Run button of that script file.
The first line of your main script file must be:
clear all; close all;
This command will clear the workspace and close all the figure windows.
Code complexity
1 pt – Code enables accurate translation of “-…/–/./-…./—–/-…/..–.- /./…-/./.-./-.–/..–.- /-/..-
/./…/-../.-/-.–/..–.- /.-/-./-../..–.- /-/…./..-/.-./…/-../.-/-.–/”.
2 pts – same as “1 pt”, but also with a basic pie-chart showing the letter components.
3 pts – same as “2 pt”, but also with a well-labeled pie-chart showing the details of letter
components (like the exploded pie-chart example in the first page).
4 pts – same as “3 pt”, but also allows translation of multiple Morse codes and well-labeled
subplot pie-chart.
Code commenting
1 pt – >10% of lines of code are commented with a useful comment
2 pts – >20% of lines of code are commented with a useful comment
Use of functions
1 pt – a separate function exists for translating Morse code to English.
2 pts – same as “1 pt”, but also with a function that plots pie-chart accordingly.
Code format
1 pt – Cleanness: with proper indent, minimal Matlab warning (i.e. red line underneath the
variables), and without nested functions.
2 pts – same as “1 pt”, but also minimize the code redundancy (for instance, instead of treating
each letter/morse code as an individual respectively, get familiar with Array Index).