Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

matlab no ifs please Function Name: scales Inputs 1. 2. (double) Vector of numbers representing notes (char) Note you want to count Outputs 1. 2.

image text in transcribedmatlab no ifs please

Function Name: scales Inputs 1. 2. (double) Vector of numbers representing notes (char) Note you want to count Outputs 1. 2. (char) Vector of note names (double) Number of times the note specified in the input occurs Background You are an artist about to perform at Music Midtown. Before you go on stage, you better warm up! Normally you warm up by singing musical scales, but you decide try something different and use the set of warmups your friend gave you beforehand. However, she gave them to you in a weird format. You decide to use MATLAB to convert your friend's warmups into the notes that you understand! Function Description You have been given a vector of integers greater than or equal to 0. You want to make sure that you don't strain your voice before the big show, so you limit the range by deleting every number representing a note greater than 18. Each number corresponds to one of seven musical notes, whose names range from 'A' to'G'. The numbers (0, 7, 14, ) correspond to the note 'C', the numbers {1, 8, 15, ) correspond to 'D', etc. The numbers f5, 12, 19, } correspond to 'A' and (6, 13, 20, ) correspond to 'B'. Output a character vector of the note names that correspond to the numbers in the first input. Then, count how many times the note specified in the second input occurs in the vector, and output that count as the second output. Example: notes, count] - scales ([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14], 'C) notesCDEFGABCDEFGABC count 3 Notes: The mod () function will be useful Hints Turn on your volume and run the solution function a bunch for some cool easter eggs

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

The Database Factory Active Database For Enterprise Computing

Authors: Schur, Stephen

1st Edition

0471558443, 9780471558446

More Books

Students also viewed these Databases questions

Question

=+ d. a professor deciding how much to prepare for class

Answered: 1 week ago