Get Instant Help From 5000+ Experts For
question

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing:Proofread your work by experts and improve grade at Lowest cost

And Improve Your Grades
myassignmenthelp.com
loader
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!
Free Quote
wave
Matlab Programming for Data Analysis Coursework

Marking Criteria

This coursework will test some concepts of Matlab programming for data analysis, including writing scripts, functions, plotting, manipulating strings and using cell arrays and structure variables.

This coursework is assessed and mandatory and is worth 40% of your total final grade for this course. In order to obtain full marks for each question, you must answer it correctly but also completely, based on the contents taught in this course.

It will be important to provide input and output arguments to the functions as requested in the exercises. Unless explicitly specified in the exercise, avoid using the “input” function or printing outputs on the command window.

Marks will be given for writing elegant, compact, vectorised code, avoiding the use of “loops” (for or while loops) where possible, and including comments.

The files you submit cannot be overwritten by anyone else, and they cannot be read by any other student. You can, however, overwrite your submission as often as you like, by resubmitting, though only the last version submitted will be kept. Submission after the deadline will be accepted, but it will automatically be recorded as being late and is subject to College Regulations on late submissions.

o A file containing function waferstore required for exercise 1.

o A file containing function countdown required for exercise 2.

o A file containing function mycos required for exercise 3.

o A file containing function buildrandomstrings required for exercise 4.

o A file containing function calctrianglearea required for exercise 5.

o A file containing function myangle required for exercise 6. This exercise also requires you to

write another function which you can write in an extra file with a name of your choice.

o Two scripts myevalue1 and myevalue2 required for exercise 7.

o A file containing function sumcomplex required for exercise 8.

o A file containing function wordscountstarting required for exercise 9.

If you will write any other extra function or script as part of your solution for these exercises, you should also submit these. For these extra functions or scripts, you can choose the file name.

A zip file containing a template for each of these files is provided on the course page on Moodle. You need to insert your code for each exercise where indicated and submit them. The file “LittleMermaid.txt”, which you will need for exercise 9, is also provided in the same zip file.

A silicon wafer manufacturer stores, for every part in their inventory, a part number, how many there are in the factory, and the cost for each part. Create a function called “waferstore”, that will:

Submission Requirements

• Take as input arguments 3 vectors, one containing the part numbers, one containing the quantities and one containing the costs of the parts in the inventory.

• Build an array of structs containing, for each part, number, quantity and cost. If displayed, the array of structs could look something like this

The function will then calculate the areas of the triangles whose vertices are the sets of 3 consecutive points in the matrix, starting with the first point and using each point only once (that is, it will first calculate the area of the triangle whose vertices are points 1, 2, 3; then it will calculate the area of the triangle whose vertices are points 4, 5, 6; and so on).

The function will provide as output argument a vector containing the area of each triangle. The function will write a message to the user explaining how many triangle areas have been calculated; the message will also contain the coordinates of any points which were not used (in case n is not a multiple of 3). [Hint: it might be useful to create a separate function that calculates the length of the side formed by any two points (the distance between them)].

Write a function called “myangle” for angle conversions between degrees and radians.

• myangle will receive as input arguments two numbers, representing the minimum and maximum angles in degrees.

• myangle will provide as output argument a matrix M with 2 columns: the first column will contain the angle in degrees, from the minimum to the maximum, in steps of 1 degree; the second column will contain the corresponding angle in radians. The conversion is:

R = (D * ?)/180 where D is the angle in degrees and R the corresponding angle in radians.

• myangle will also call another function (you can choose any name for it), which will receive as input argument the matrix M and will print in the command window two columns: the first column containing the angle in degrees ordered from the minimum to the maximum, and the second column containing the corresponding angle in radians.

• Note that the input arguments can be provided to myangle in any order; that is myangle (0, 10) and myangle (10,0) will generate the same output.

The inverse of the mathematical constant e can be approximated as follows:

Write a script “myevalue1” that will loop through values of n until the difference between the approximation

Exercises

of e and the actual value of e (that is, the built-in value of e) is less than 10!". The script should then print

out the built-in value of e and the approximation to 5 decimal places, and also print the value of n required for such accuracy.

Where n! indicates the factorial of n. Write a script "myevalue2" that will provide an approximation of e using this formula such that the difference between the approximation and the actual value of e is less than 10!". The script should then print out the built-in value of e and the approximation to 5 decimal places, and also print the value of n required for such accuracy.

The third vector, S, will be a vector of indices, indicating which of the n complex numbers should be added. For example S = [1, 3, 4] indicates that the first, third and fourth complex numbers should be added. sumcomplex will perform the addition and provide two output arguments. The first output argument will be the array of structures containing all the complex numbers. The second output argument will be the result of the sum as specified in vector S. sumcomplex will also check that the lengths of vectors R and I are the same and provide to the user a proper error message if they are of different length. sumcomplex will also check that S does not contain indices larges than n and provide to the user a proper error message if necessary.

Write a function "wordscountstarting" that will read the text file “LittleMermaid.txt” provided in the zip file on the Moodle page. Wordscountstarting will receive as input arguments an integer n and a character c and return two output arguments:

• The first output argument will be a cell array containing the n most frequent words among those starting with c in the text, together with the number of times they occur.

• The second output argument will be the total number of occurrences of words starting with c in the text.

Words countstarting will need to be case-insensitive; for instance, if c is either 's' or 'S', then both the words  “Sea” and “sea” should be considered as starting with c, and should be counted as two occurrences of the same word. If several words appear the same number of times, then any of them can be provided in the output. (Hint: you can use the function textread to read a text file)

support
Whatsapp
callback
sales
sales chat
Whatsapp
callback
sales chat
close