subject

Write a MATLAB script in which you initialize the following vector:

ANIMALS = ["cow", "cat", "dog", "fox", "lion", "bear", "sea lion", "deer", "dolphin"];

a. In the script, use logical indexing to create a vector called C_ANIMALS that is comprised of the animals from the above ANIMALS vector starting with the letter c. This should be done with just one line of code. HINT: MATLAB provides a built-in function that checks whether a string starts with a specified letter. Feel free to research and use this built-in function.

b. In the script, use logical indexing to create a vector called LETTERS_3 that is comprised of the animals from the above ANIMALS vector that are three letters long. This should be done with just one line of code. HINT: MATLAB provides a built-in function that checks whether a string’s length is equal to a certain number. Feel free to research and use this built-in function.

c. In the script, use logical indexing to create a vector called D_GREATER_3 that is comprised of the animals from the above ANIMALS vector that are greater than three letters long and start with the letter d. This should be done with just one line of code.

d. Display all the vectors created in this script: ANIMALS, C_ANIMALS, LETTERS_3, and D_GREATER_3.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
You have a large, late-model pick-up truck with a rear seat. the pick-up truck weighs 6,500 pounds. the florida seat belt law
Answers: 1
question
Computers and Technology, 23.06.2019 02:50
There’s only one game mode that stars with the letter ‘e’ in cs: go. which of the options below is it?
Answers: 1
question
Computers and Technology, 23.06.2019 09:10
Effective character encoding requires standardized code. compatible browsers. common languages. identical operating systems.
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Aspeed limit sign that says "night" indicates the legal speed between sunset and sunrise.
Answers: 2
You know the right answer?
Write a MATLAB script in which you initialize the following vector:

ANIMALS = ["cow", "c...
Questions
question
Mathematics, 08.07.2019 04:30
question
Chemistry, 08.07.2019 04:30
question
Social Studies, 08.07.2019 04:30
Questions on the website: 13722367