# We Helped With This MATLAB Programming Assignment: Have A Similar One?

SOLVED
Category Programming MATLAB College Solved Matrix Rotation In Matlab

## Short Assignment Requirements

Please read the "PLEASE READ THIS FIRST. DOCX" first. There are 3 problems to solve. All the programs should be done in MATLAB programming. I have attached the .zip folder, everything is listed inside that.

## Assignment Description

Function Name: structDisp

Inputs:

1. (struct) An MxN structure array

Outputs:

1. (char​  ) A PxQ character array where P = (number of fields + 1) * M and Q = 50 * N

Function Description:

MATLAB does fine when displaying a single structure. It shows all of the fields and their contents. But when you try to display a structure array, it just says, “MxN structure array with the fields:” and then lists the fields. This is not particularly useful if you want to see the data contained in the structure array. So you are going to write a function to remedy this problem!

You will output a character array that shows the entire structure array, including its contents. The structure array will be a concatenation of the output that MATLAB returns for an individual structure. You have been given a helper function struct2charArr(), which takes in a 1x1 structure and turns it into an MxN character array, where M is the number of fields in that structure plus one (there is an extra empty line at the bottom is meant to create space between this and the next structure), and N is the minimum number of columns needed to fully capture the data in the fields. If there is a long vector contained in one of the fields, N may be very large. On the other hand, if all of the fields in the structure contain short data entries, N may be small. The easiest way to see what the helper function outputs is to try it with different 1x1 structures.

Given this unwanted variation in column sizes, you should manipulate each output character array so that it contains exactly 50 columns. In other words, if the data in one structure is short, you will need to extend (the right side of) the columns of the output of the helper function with spaces. If the data is long, you will need to remove some of the output. Simply remove all columns after 50 and don’t worry about displaying the overflow data.

Finally, you will concatenate each character array into your larger output character array in the dimensional order that the structures appeared in the original input.

Notes:

Use the isequal() function with your code and the solution code to check your answers. You should be doing this anyway, but it is especially important on this problem as there are lots of spaces in these character arrays and you won’t be able to easily see differences.

You can also use == to see which (if any) characters are incorrect.

The size of a single character array output from the helper function will have the rows dependent on the number of fields, but remember that the size of a structure is independent of the number of its fields.

Function Name: movieStar

Inputs:

1. (struct) A 1xN structure array of movie data

Outputs:

1.    (char) The highest paid actor/actress

2.    (double) The total amount of money he/she made

3.    (double) The average movie rating of movies he/she appeared in

Function Description:

As a self-described movie buff, you enjoy spending your time doing all kinds of research about the film industry. This week, you've decided to do some research about how much actors and actresses are paid, using data from a structure array that you found on the internet.

The structure array will always have the following fields, and may have other fields.

 Field name Data within field Bad_Vegetable_Score A decimal percent between 0 and 1 Budget A double Revenue A double Cast An Mx1 cell array of cast member names

An example structure can be seen below:

sa(1) =>

Movie_Name: 'Puzzles'

Year: 1984

Genre: 'Mystery'

Run_Time: '1h43m'

Director: 'Kim Coppola'

Budget: 5000000

Revenue: 5500000

Profit: 500000

Cast: {'John Cena';

'Stew Leonard';

'Sam Walton';

'Aunt Jemima';

'Betty Crocker'}

MPAA_Rating: 'PG-13'

To calculate the highest paid actor, you should assume that the profit from the movie is split evenly between all of the actors/actresses in the movie. The profit of the movie is the difference between the budget and the revenue. If the movie lost money (revenue less than budget), then assume none of the cast members made any money. Once you have determined the highest paid actor/actress, you need to determine the average rating of the movies he/she was in. However, because you are assuming the highest paid actor/actress is a self-respecting individual, you should remove all movies in which Nicolas Cage is a co-actor before calculating the average movie rating. Additionally, if Nicolas Cage is the highest paid actor, you should assume there is a mistake in the data and output values for the second highest paid actor/actress.

Notes:

The actor/actress money should be calculated before removing Nicholas Cage.

An actor or actress' name will always appear exactly the same way in any movie in which they acted. Nicolas Cage will always appear as 'Nicolas Cage'. ● An actor or actress will appear in the cast section only once per movie.

In the case of a tie for highest paid actor/actress, select the actor/actress whose name appears first alphabetically.

You should round every money calculation to two decimal places.

Round the average rating output to two decimal places.

Function Name: careerFair

Inputs:

1.    (char) A string for the filenames of resumes

2.    (double) The number of resumes you must process

Outputs:

1.    (struct) An 1xM structure array representing all the applicants

2.    (struct) An 1xN structure array representing the selected applicants

Function Description:

As a new hire in your company's HR department, your first task is to attend a campus recruiting career fair. Overwhelmed by the stacks of resumes, you decide to write a function named careerFair() that will help you process through the large pool of applicants to select the best candidates.

You will be given a list of resumes as text files. The filenames will always be formatted as <input1>##.txt, where <input1> is the first input and ## is the resume number. The second input specifies the number resumes you need to process through. For example, given 'Resume' and 18 as the first two inputs, the files you need to work with would be

Resume01.txt, Resume02.txt up to Resume18.txt.

In order to organize the applicants, you need to create a structural array where each structure contains information about one specific applicant. The fields of the structures are Name(char), GPA(double), Education(char), and Skills(cell)​ ​. The information can be extracted from the resume file. If any of the fields exist in the text, it will be organized as

<Field>: Information, where <Field> is one of the above categories, and Information is the data you must store inside that field. These headers may exist in any line in the text and in any order, but they are guaranteed to be present. The information should be stored as the class type specified - the contents of Name and Education should have no leading or trailing whitespaces. Skills will contain a comma separated list; each skill should be stored in a cell and also have no leading or trailing whitespaces. Because you are specifically interested in MATLAB experts, you will include an additional field MATLAB(double), which will contain the number of occurrences of 'MATLAB' in the resume. Your count should be case sensitive, and can include cases where MATLAB is a substring of another word.

For example, given a text file containing the following lines:

1  This is Waldo. I dare you to find me. #MATLAB

2  Name: Waldo

4  Skills: Hiding, MATLAB

5  GPA: 4.0

6  Education: National Institute of Hiding

The structure for this applicant would be

applicant =

Name: 'Waldo'

Skills: {'Hiding'  'MATLAB'}

GPA: 4

Education: 'National Institute of Hiding'

MATLAB: 2

Each applicant should be added to a structure array, which is the first output of the function. It will have an 1xM dimension, where M is the same as the second input (number of resumes to process).

Now that you have compiled your pool of applicants, it is time to develop the criteria to select the best candidates. You decide to use the candidate GPA as the baseline for comparison, given a few caveats. As a proud Yellow Jacket, if any applicant received his or her Education from 'Georgia Institute of Technology' or 'Georgia Tech', multiply the GPA by 1.5 since you know how hard it is to earn a good GPA here. However, if any applicant received his or her Education from 'UGA' or 'University of Georgia', multiply the GPA by 0.75. Lastly, add the number of occurrences of 'MATLAB' found to each candidate's GPA. This will be a candidate's score. To select the best applicants, remove those who have a score less than the median of all the scores. Sort the remaining candidates by their score in descending order. This will be your second output.

Notes:

You can use '%02.0f' instead of '%d'​           ​ in sprintf() to format numbers as 2 digits.

You will not be given more than 99 resumes.

You can use strtrim() to remove  leading and trailing whitespace from a string.

Once you have the first output, you should not need iteration to generate the second output.

## Assignment Description

PLEASE READ THIS FIRST BEFORE YOU START WORKING ON ANY PROBLEMS.

Instructions:

All the program should be done in MATLAB programming.

There are total of 3 problems to solve.

All the program should follow the exact requirements, they will be testing each program with all the possible combinations listed and unlisted and failure to run the program smoothly will result in an automatic 0. So please pay extra attention to all the details carefully.

Please check all the folders. Each folder contains the solution file (the .p file) for that problem and contains other very important useful resources.

Once you are done writing code, please make sure to run the test cases listed in the Test Cases.docx file to make sure the program runs smoothly.

Also, once done programming, please make sure the program runs perfectly by loading each of the listed .mat file and .txt files to make sure the program runs smoothly. Each problem contains the solution file (the .p file), so please make sure you compare  your answers with the .p file in each possible combinations on top of the given test cases to make sure each program runs perfectly without any kind of errors and satisfies all the micro detailed instructions listed in the Assignment.pdf file.

## Assignment Description

%% PART 3. Testing Your Code

%--------------------------------------------------------------------------

%

% You may use the following test cases for each problem to test your code.

% The function call with the test-inputs is shown in the first line of each

% test case, and the correct outputs are displayed in subsequent lines.

%

%% Function Name: structDisp

%

% Setup:

%

% Test Cases:

% [disp1] = structDisp(bestOfTAIndex)

%   disp1 =>

%         favHashtag: '#hashbrowns'

%           bestJoke: 'Test team, best team #lolz'

%            MacOrPC: 'PC'

%    when5growUpToBe: 'CS 1371 TA'

%             bestAt: 'zoning out'

%      favMATLABfunc: 'help'

%           favQuote: 'You can never be overdressed

%

%

% [disp2] = structDisp(halogens)

%   disp2 =>

%        symbol: 'F'

%     atomicNum: 9

%    atomicMass: 18.998

%

%        symbol: 'Cl'

%     atomicNum: 17

%    atomicMass: 35.453

%

%        symbol: 'Br'

%     atomicNum: 35

%    atomicMass: 79.904

%

%        symbol: 'I'

%     atomicNum: 53

%    atomicMass: 126.904

%

%        symbol: 'At'

%     atomicNum: 85

%    atomicMass: 210

%

%--------------------------------------------------------------------------------

%% Function Name: movieStar

%

% Setup:

%

% Test Cases:

% [cast1, money1, avg1] = movieStar(movieStruc1)

%   cast1 => Adam Silverman

%   money1 => 5

%   avg1 => 0.7400

%

% [cast2, money2, avg2] = movieStar(movieStruc2)

%   cast2 => Jessica Chastain

%   money2 => 1.2814e+08

%   avg2 => 0.8600

%

% [cast3, money3, avg3] = movieStar(movieStruc3)

%   cast3 => Zoe Saldana

%   money3 => 7.5015e+08

%   avg3 => 0.9100

%

% [cast4, money4, avg4] = movieStar(movieStruc4)

%   cast4 => Zoe Saldana

%   money4 => 7.9062e+08

%   avg4 => 0.7800

%

%--------------------------------------------------------------------------------

%% Function Name: careerFair

%

% Test Cases:

% [overall1, best1] = careerFair('CFBResume',5)

%   overall1 => Structure/Structure array should match that of the solution function

%   best1 => Structure/Structure array should match that of the solution function

%

% [overall2, best2] = careerFair('TAResume',10)

%   overall2 => Structure/Structure array should match that of the solution function

%   best2 => Structure/Structure array should match that of the solution function

%

% [overall3, best3] = careerFair('NBAResume',14)

%   overall3 => Structure/Structure array should match that of the solution function

%   best3 => Structure/Structure array should match that of the solution function

%

## Frequently Asked Questions

Is it free to get my assignment evaluated?

Yes. No hidden fees. You pay for the solution only, and all the explanations about how to run it are included in the price. It takes up to 24 hours to get a quote from an expert. In some cases, we can help you faster if an expert is available, but you should always order in advance to avoid the risks. You can place a new order here.

How much does it cost?

The cost depends on many factors: how far away the deadline is, how hard/big the task is, if it is code only or a report, etc. We try to give rough estimates here, but it is just for orientation (in USD):

 Regular homework \$20 - \$150 Advanced homework \$100 - \$300 Group project or a report \$200 - \$500 Mid-term or final project \$200 - \$800 Live exam help \$100 - \$300 Full thesis \$1000 - \$3000

How do I pay?

Credit card or PayPal. You don't need to create/have a Payal account in order to pay by a credit card. Paypal offers you "buyer's protection" in case of any issues.

Why do I need to pay in advance?

We have no way to request money after we send you the solution. PayPal works as a middleman, which protects you in case of any disputes, so you should feel safe paying using PayPal.

Do you do essays?

No, unless it is a data analysis essay or report. This is because essays are very personal and it is easy to see when they are written by another person. This is not the case with math and programming.

Why there are no discounts?

It is because we don't want to lie - in such services no discount can be set in advance because we set the price knowing that there is a discount. For example, if we wanted to ask for \$100, we could tell that the price is \$200 and because you are special, we can do a 50% discount. It is the way all scam websites operate. We set honest prices instead, so there is no need for fake discounts.

Do you do live tutoring?

No, it is simply not how we operate. How often do you meet a great programmer who is also a great speaker? Rarely. It is why we encourage our experts to write down explanations instead of having a live call. It is often enough to get you started - analyzing and running the solutions is a big part of learning.

What happens if I am not satisfied with the solution?

Another expert will review the task, and if your claim is reasonable - we refund the payment and often block the freelancer from our platform. Because we are so harsh with our experts - the ones working with us are very trustworthy to deliver high-quality assignment solutions on time.

## Popular Solved Assignments Like This

Customer Feedback

"Thanks for explanations after the assignment was already completed... Emily is such a nice tutor! "

Order #13073

Find Us On