Question: Filename sineseries.m The sine function can be represented by the following series: sin(theta) = sigma_i=0^infinity (-1)^i/(2i + 1)! Theta^2i + 1 = theta - theta^3/3!

Filename sineseries.m The sine function can be represented by the following series: sin(theta) = sigma_i=0^infinity (-1)^i/(2i + 1)! Theta^2i + 1 = theta - theta^3/3! + theta^5/5! - theta^7/7! + theta^9/9! - ellipsis This is an equality as long as the sum includes all terms for i = 0 ellipsis infinity, but the series can also provide a useful approximation for sin(theta) by truncating the sum after N terms (i.e., for i = 0 ellipsis N - 1). For example, truncating the series after three terms gives the following approximation: sin(theta) TildeTilde theta - theta^3/3! + theta^5/5! Write a MATLAB function that uses the series given above to calculate an approximation for sin(theta). Function syntax: y = sine series (theta, N); The angle input, theta, should have units of radians. The second input argument, N, specifies the number of terms to use in the approximation, and should be an optional input with a default value of N = 10 Filenames: funcstat.m MAE 1090_HW10_4.m. Write a function function m-file, funcstat.m, that calculates the minimum, maximum, and mean values for a function evaluated over a specified vector of independent variable values Function syntax: [fmin, fmax, fmean] = funcstat (f, x); The first input to the function, f, is a function handle, and the second input, x, is a vector of values over which to evaluate the function f. The outputs are the minimum, maximum, and mean values of f (x). (Note that these don't represent t true minimum, maximum, and mean of the function itself, but only the minimum, maximum, and mean of the values that result from evaluating the function at the given x values.) Calculate fmin, fmax, and fmean without using MATLAB's built-in statistical functions (i.e., min.m, max.m, and mean.m). Write a second m-file, MAE1090_HW10_4.m, in which you define the following as an anonymous function: f(x) = cos(5(x - 5))[cos(0.2(x - 6)) - 0.5] Write your anonymous function such that it can operate on vectors of independent variable values. Generate a vector of x values ranging from 0 to 10 in steps of 0.01. Pass the handle to the anonymous function and the x vector to funcstat.m and display the results to the command window
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
