May 17, 2025

Test 3

1.) Write a working MATLAB code that will compute the solution of the following nonlinear equation:

(1)   \begin{align*}x^{2}+cos(x)=0\end{align*}


using the MATLAB fsolve() function.

2.) Using the MATLAB ode45() function, solve the following ordinary differential equation:

(2)   \begin{align*}\frac{dx}{dt}=-x\end{align*}



choose a zero initial condition.