How to solve this equation?

4 views (last 30 days)
Hi everyone,
I want to solve this equation in Matlab. Until now I have the following code:
a=18
b=60
c=76.7
syms x
solx=solve('cos(x).*(a.*sin(x)+b)=c','x')
I get next error: Check for missing argument or incorrect argument data type in call to function 'solve'.
Error in Untitled (line 8)
solx=solve('cos(x).*(a.*sin(x)+b)=c','x')
I dont know what it is wrong, can anybody help me?
Any help is appriciated.
  4 Comments
Mario Malic
Mario Malic on 4 Sep 2020
You're missing double equals sign in your equations.

Sign in to comment.

Accepted Answer

Ali Muhammad Hassaan
Ali Muhammad Hassaan on 29 Aug 2020
a=18
b=60
c=76.7
syms x
eqn = cos(x).*(a.*sin(x)+b) == c
solx=solve(eqn)
  2 Comments
Vladimir Sovkov
Vladimir Sovkov on 29 Aug 2020
The sintax is correct here but it is of no help to find the solution, because there is no real-type one, and "solve" refuses working with the complex type. To find the solution you should reformulate the problem as a system of two real-type equations for the real and imaginary parts being two unknown variables.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!