(Solved) : Inputs 1 Char Character Vector Three Words Outputs 1 Double 1×3 Vector Lengths Word Backgr Q44095117 . . .
inputs:
1. (char) A character vector of three words Outputs:
1. (double) A 1×3 vector with the lengths of each word
Background:
You know how sometimes you just really want to know the lengthof a word, but for specifically three word sentences? You don’t?!Oh well, let’s make a function to do it anyway.
Function Description:
Given a sentence of three words separated by spaces, find thelength of each word and output the values as a vector.
Example:
lens = wordLen(‘Matlab rocks dude’) lens → [6 5 4]
Notes:
-
● Words will only be separated by spaces.
-
● There will never be any punctuation.
Expert Answer
Answer to inputs: 1. (char) A character vector of three words Outputs: 1. (double) A 1×3 vector with the lengths of ea…
OR