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:
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started