Write a MATLAB script to find the first positive and first n

Write a MATLAB script to find the first positive and first negative solutions (i.e., the ones the smallest absolute values) to the following nonlinear algebraic equation using the fzero command. 7x = 4.5 + x^3 cosx

Solution

function y=f(x)

y=4.5+x3cosx-7x % Taking in terms of y

fun=@f % function

x0=2 % initial point

z=fzero(fun,x0)

 Write a MATLAB script to find the first positive and first negative solutions (i.e., the ones the smallest absolute values) to the following nonlinear algebrai

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site