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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:50, savagesquid4807
Before you enter an intersection on a green light make sure
Answers: 2
image
Computers and Technology, 22.06.2019 06:00, kamilahmcneil3969
What are the most likely causes of conflict at the meeting? check all that apply.
Answers: 1
image
Computers and Technology, 22.06.2019 16:30, buky0910p6db44
Corey set up his presentation for delivery to his team. the information he had to convey was critical to their job performance. he knew he would need a lot of time to explain each point
Answers: 3
image
Computers and Technology, 23.06.2019 00:00, eguzmandpandoracom
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
You know the right answer?
Write a MATLAB script in which you initialize the following vector:

ANIMALS = ["cow", "c...

Questions in other subjects:

Konu
Mathematics, 20.04.2021 02:50