Question: PART 1) Create a MATLAB function(UDF) called mystep Hint: if x is a vector variable in MATLAB, y = cos(x) will create a vector y

PART 1) Create a MATLAB function(UDF) called mystep Hint: if x is a vector variable in MATLAB, y = cos(x) will create a vector y of values such that each element of y is the cosine function of each element in x.
1) Accept input variables for c, L, N, and vector of values x
2) Approximate the step function, f(x), according to the Fourier series provided above, over the input range of x values
3) Return an output variable for a vector of values f(x) (evaluated at each value of x)
PART 2) Create MATLAB script that will:
1) Ask for user input values for c, L and N
2) Call UDF named mystep (described in part 1) to approximate f(x) for x values between 0 and 2L with a step size of 2L/100
3) Graph f(x) as a function of x over 0 x 2L
Problem 2: Step functions and Fourier series are used in controls aerospace systems. In this problem, you will compute and graph a Fourier series that approximates a step function. The step function shown in figure 1 f(x) 2c 0 2L x Figure 2: Step function can be approximated over the range 0sx2L using the following Fourier series: k=N k-1 where c
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
