Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Function Name: scales Inputs: 1. (double) Vector of numbers representing notes 2. (char) Note you want to count Outputs: 1. (char) Vector of note names

image text in transcribed

Function Name: scales Inputs: 1. (double) Vector of numbers representing notes 2. (char) Note you want to count Outputs: 1. (char) Vector of note names 2. (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 sever musical notes, whose names range from 'A' to 'G'. The numbers 50, 7, 14,.. correspond to the note 'C', the numbers f1, 8, 15, correspond to 'D', etc. The numbers f5, 12, 19, ...1 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([e,1,2,3,4,5,6,7,8,9,10,11,12,13,14], 'C') notes - 'CDEFGABCDEFGABC' 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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

7-5 How will MIS help my career?

Answered: 1 week ago

Question

2. What type of team would you recommend?

Answered: 1 week ago