Create three cell array variables that store people’s names, verbs, and nouns. For example
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:8| Question number:5.8
All Answers
total answers (1)
Ch8Ex5.m
% Create random silly sentences from cell arrays
names = {'Harry', 'Xavier', 'Sue'};
verbs = {'loves', 'eats'};
nouns = {'baseballs', 'rocks', 'sushi'};
name = names{randi([length(names)])};
verb = verbs{randi([length(verbs)])};
noun = nouns{randi([length(nouns)])};
fprintf('%s %s %s\n', name, verb, noun)
need an explanation for this answer? contact us directly to get an explanation for this answer