Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

inputs: 1. (char) A character vector of three words Outputs: 1. (double) A 1x3 vector with the lengths of each word Background: You know how

inputs:

1. (char) A character vector of three words Outputs:

1. (double) A 1x3 vector with the lengths of each word

Background:

You know how sometimes you just really want to know the length of 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 the length 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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

3. Outline the four major approaches to informative speeches

Answered: 1 week ago

Question

4. Employ strategies to make your audience hungry for information

Answered: 1 week ago