Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions