Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please answer this question using the function only contained in the basic Matla

ID: 3909175 • Letter: P

Question

Please answer this question using the function only contained in the basic Matlab Indtallstion. Do not use functions from optional toolboxes and do not answer the question as a function. Thank you!

Homework Problem 2: Find Vowels In this problem, create a script file name findVowels.m. In the first line, define a two-dimensional cell array charCell. Each cell contains a character array. Create vowels which is a cell array with the same dimensions as charCell that contains the vowels of each entry. Your code should be able to reproduce the following test case: If charCell is defined as charCell {(Sushrut, then your array vowels should be: 2x2 cell array (Pande, ; (Engineering,, ‘Seven'); ?? , Store the code of this problem in the filename find Vowels.m. This file must go into your zipped folder as it will be evaluated.

Explanation / Answer

findVowels.m

charCell = {'Sushrut', 'Pande'; 'Engineering', 'Seven'};
isvowel = @(s) ismember(lower(s), 'aeiou');
idxV = cellfun(isvowel, charCell, 'unif', 0);
vowels = cellfun(@(s,i) lower(s(i)), charCell, idxV, 'unif', 0)