Question :
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?
1. syms x;eqn = cos(x) == 1/2;vpa( solve(eqn,x)) 2. syms x;eqn = cos(x) == 1/2;solve(eqn,x) 3. vpa(solve('cos(x)=1/2')) 4. syms x;eqn = cos(x) = 1/2;vpa(solve(eqn,x)) Answer :
3 - vpa(solve('cos(x)=1/2'))
|