Write a used-defined function that calculates the average


Assignment

Use MATLAB to solve each problem by writing script files; copy and paste the script file AND the results in the Command Windowand/or plot in the Figure Windowto a WORD document that has your name and section in the headers of each page and the page number in each footer. Edit the output to remove extra lines and empty spaces. The script files SHOULD have comments for easy readability; take a print out of the Word file andstaple before submission.

1. Write a used-defined function that calculates the average and the standard deviation of a list of numbers. Use the function to calculate the average and the standard deviation of the following list of grades: 80 75 91 60 79 89 65 80 95 50 81

Note: The average x_ave (or mean) of a given set of n number x_1,x_2,.....,x_n is given by:

x_ave=(x_1+x_2+x_3+?+x_n)/n

The standard deviation is given by: σ=√((∑_(i=1)^(i=n) (x_i-x_ave )^2 )/(n-1))

DO not use built-in functions to calculate the mean and the standard deviation.

2. Write a user-defined function that arranges the digits of a given (positive) number in a row vector in the same order as they appear in the number; the function should also arrange the digits in the decimal part in a different vector. For example, if the number is 2645.12, the vectors should be [2 6 4 5] and [1 2]. The whole number can be from 0 to 10 digits long and the decimal part 0 to 6. Check the validity of the function using a few numbers of your choice.

3. A fenced enclosure consists of a rectangle of length L and width 2R, and a semicircle of radius R, as shown in Figure.

1759_Semicircle.jpg

The enclosure is to be built to have an area A of 1600 ft2. The cost of the fence is $40 per foot for the curved portion, and $30 per foot for the straight sides. Determine the values of R and L required to minimize the total cost of the fence and the minimum cost using calculus approach.

A water tank consists of a cylindrical part of radius r and height h, and a hemispherical top. The tank is to be constructed to hold 500 meter3 of fluid when filled. The cost to construct the cylindrical part of the tank is $300 per square meter of the surface area; the hemispherical part costs $400 per square meter. Determine the radius that results in the least cost and compute the corresponding height and the cost using graphical approach. Verify your results using the calculus approach.

A ceramic tile has the design shown in the figure.

2481_Sin_Wave.jpg

The shaded area is painted black and the rest of the tile is white. The border line between the red and the white areas follows the equation:

y=Asin(x)

Determine A such that the area of the white and black colors will be the same.

 

Request for Solution File

Ask an Expert for Answer!!
MATLAB Programming: Write a used-defined function that calculates the average
Reference No:- TGS02255037

Expected delivery within 24 Hours