Question: [MATLAB] HW7P2 (20points)- (5 pts) Write a user-defined MATLAB function called HW7P2_fn for the following math function: The input to the function is x and

[MATLAB]

[MATLAB] HW7P2 (20points)- (5 pts) Write a user-defined MATLAB function called HW7P2_fn

HW7P2 (20points)- (5 pts) Write a user-defined MATLAB function called HW7P2_fn for the following math function: The input to the function is x and the output is y. Write the function such that x can be an array (use element-by-element operations). (15 pts) Use the function in (a) the command window to calculate y[-2) and y(5) (b) a script file HW7P2.m to determine y(x) for 0.001 S the linspace function to create the x vector. x 10 with 1000 points. Hint: Use (c) In the same script file HW7P2.m, plot the function y(x) 4 times in 2 by 2 subplots using the following:* 1. Linear scale for both the x and y axes. 2. Linear scale for the x axis and logarithmic scale for the y axis. 3. Linear scale for the y axis and logarithmic scale for the x axis. 4. Logarithmic scale for both the x and y axes. Use the axis ) function to adjust the limits of the x axis from the minimum value of x to the maximum value of x and the same for the y axis. You can use the functions min) andmax () in MATLAB after reading their help sections

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!