Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Exercise 1-Graphing function using MATLAB 1. Consider the function fc) (x-m) exp

ID: 3834733 • Letter: E

Question

Exercise 1-Graphing function using MATLAB 1. Consider the function fc) (x-m) exp(-(x-m where, m is the average digit in ID number n is the maximum digits in your ID number ID number: 201203014 (a Define your constant m and n (using the functions: "mean" and "max") b) Declare your variable x (as your smbolic variable) c) Define the function (using the function: inline') d Find the first and the second derivatives ofthe function (using the function: "diff). c) Find y-intercept of the function f. Find the x-intercept of the function (solve for f(x) 0) Find the critical points of the function (solve for fox) 0 h Find the infection points of the function (solve for f"(x) 0) Plot the function f D Plot the critical points D Determine the intervals where the function f is increasing and decreasing. m) Determine the intervals where the function fis concave- up and concave down. 196 of 271 1 of 2 Write a MATLAB CODE to answer the question

Explanation / Answer


% Defining Constants
m = 1.4444
n = 4


pkg load symbolic
syms x

f = inline('((x-m).^n) .* exp(-((x-m).^2))', 'x')

% First derivative of f(x)
first_derv = diff(f(x))


% Second derivative of f(x)
second_derv = diff(diff(f(x)))

% y intercept, solve for x = 0
y_intercept = f(0)


% x_intercept, solve for f(x) = 0
eqn1 = f(x) == 0;
x_intercept = solve(eqn1,x)


% critical points
eqn2 = diff(f(x)) == 0
critical_vals = solve(eqn2, x)


% inflection points
eqn3 = diff(diff(f(x))) == 0;
inflection_vals = solve(eqn3,x)


ezplot(f(x))
hold on
plot(critical_vals, f(critical_vals))
hold off