Question: 1. In one single matlab script file (exercise01.m), implement: 2. Create a variable, A, whose value is the string 'hello': 3. Create a cell array,

1. In one single matlab script file (exercise01.m), implement: 2. Create a variable, A, whose value is the string 'hello': 3. Create a cell array, C, containing the strings: 'hello' 'goodbye' 'hello' 'hello goodbye' 'goodbye' 'hello' 'goodhellow' 'see you in hell'. Each index in your cell array should contain one of these strings. Note, you can create an empty cell array by setting it to an empty cell, e.g. C =: and you can add a string to the end of a cell array by e.g. C{end + 1} = 'hello': 4. Write code to count how many times the (exact) string 'hello' occurs in your array. Now write code to count how many times the word hello occurs in your array. Useful functions: for, find, strcmp, isempty, strfind. 5. Write code to find the most similar string to 'goodfellow' in your array (where similarity is measured as the number of letters in common). Useful function: intersect. In one single matlab script file (exercise02.m), implementing the following: 1. Read in the lines of the text file using the fgetl function. Store the lines of this file in a cell array. Useful functions: for, fopen, fgetl. 2. Parse your stored lines of text into their constituent words using the strtok function. Store all of the words in the entire document in a cell array with one word per index. 3. Create a lexicon consisting of all of the unique words in all the files. Useful function: unique. 4. Create a column vector representing how many times each lexicon word occurs in the document. This is a word vector representation for the document. Useful function: zeros
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
