Question: Matlab Code Function Name: mashUp Inputs: (char) The name of a text file containing song 1 (char) The name of a text file containing song

Matlab Code

Function Name: mashUp

Inputs:

(char) The name of a text file containing song 1

(char) The name of a text file containing song 2

(char) The name of a text file containing instructions on what song lines to take

Outputs:

None

File Outputs:

1. A text file containing the mashed up song

Banned: fileread() and textscan()

Background:

Since originality in the popular music industry is lost forever, you decide to mash up already existing songs to make some new singles.

Function Description:

Given the filenames of text files that contain two different songs and a third file of instructions, you will combine different lines together in a new text file. The instructions will always follow this format:

- The name of your new text file should be __mashUp.txt , where and

are the filenames from the input, without the extension.

Example:

song1.txt : We're soaring, flying

 There's not a star in heaven that we can't reach If we're trying So we're breaking free 

song2.txt : You get the best of both worlds Chill it out, take it slow Then you rock out the show You get the best of both worlds Mix it all together And you know that it's the best of both worlds

instructions.txt : 1-1

 2-2 2-3 1-4 2-1 
>> mashUp('song1.txt', 'song2.txt', 'instructions.txt') 
song1_song2_mashUp.txt: We're soaring, flying 
 Chill it out, take it slow Then you rock out the show So we're breaking free You get the best of both worlds 

Notes:

Each line of lyrics should be on its own line in the output text file.

There should not be a trailing newline at the end of the text file.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!