A student has to find the solution of an equation cos(x)=1/2. She has to write the program such that exact values are shown at output. Which of the following codes would help her?
(a) syms x;eqn = cos(x) == 1/2;vpa( solve(eqn,x))
(b) syms x;eqn = cos(x) == 1/2;solve(eqn,x)
(c) vpa(solve(‘cos(x)=1/2’))
(d) syms x;eqn = cos(x) = 1/2;vpa(solve(eqn,x))
The question was asked in homework.
My enquiry is from Solving Equations topic in portion MATLAB Basics of MATLAB