Write a function that takes as arguments a minimum value


To complete this homework assignment, turn in a m-file containing the MATLAB code that you generate in response to each problem.

1. Write a function that takes as arguments a minimum value and a maximum value and plots sin(x) from the specified minimum to the specified maximum.

2. Write a function that takes as an argument a single vector x. The function should set a new vector y equal to x and plot y as a function of x. Then, it should add noise to the y data points by adding or subtracting a random value between 0 and 25% of the original y value.

The new "noisy" data points should be plotted on the same axes as the original data points, such that both plots appear simultaneously.

3. A bar is a unit of pressure. Polyethylene water pipes are manufactured in pressure grades, which indicate the amount of pressure in bars that the pipe can support for water at a standard temperature. The following script printpressures prints to the screen some common pressure grades, as well as the equivalent pressures in atmospheres (atm) and pounds per square inch (psi). The conversions are:

1 bar = 0.9869 atm = 14.504 psi

The script calls a function to convert from bars to atm and psi and calls another function to print the results. Write these functions. printpressures.m:

%prints common water pipe pressure grades

commonbar = [4 6 10];

for bar = commonbar

[atm, psi] = convertbar(bar);

print_press(bar, atm, psi) end

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a function that takes as arguments a minimum value
Reference No:- TGS01130187

Now Priced at $15 (50% Discount)

Recommended (95%)

Rated (4.7/5)