Matlab question Create the following function in matlab fx

Matlab question

Create the following function in matlab: f(x) = ln(x + Squareroot x^2 + 1) b. Evaluate the values of function between the interval -10 lessthanorequalto x greaterthanorequalto 10. Select a step size of 0.1 and plot the function. c. Use fminbnd to find the minimum value and its location between the range -2 lessthanorequalto x greaterthanorequalto 6 d. Find the maximum value of the function. At what value of x, the maximum value occurs?

Solution

a) and b)

x=-10:0.1:10;
f= log(x+sqrt((x.^2)+1));

c)

[fmin,minpos]=fminbnd(@(x) log(x+sqrt((x.^2)+1)),2,6)

d)

[fmax,maxpos]=max(f)

Matlab question Create the following function in matlab: f(x) = ln(x + Squareroot x^2 + 1) b. Evaluate the values of function between the interval -10 lessthano

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site