I want to solve a sinus equation.
Show older comments
Hi,
I want to solve this equation for X in a function with b, c and d as parameters :
b*sin(c)=d*sin(x)
Maybe i'm seeing this wrong, but I tried to solve for X using solve() but it gives me
>> s = solve(b*sin(y)=c*sin(x),x)
??? s = solve(b*sin(y)=c*sin(x),x)
|
Error: The expression to the left of the equals sign is not a valid target for an assignment.
Edit : I want a x between 0 and 2pi.
Thanks a lot,
Seb
Answers (3)
x = asin(b*sin(c)/d)
Or, if you want MATLAB to do it:
solve('b*sin(c)-d*sin(x)','x')
You want x to be on [0 pi]? You have three unknowns to work with, so that means you will have an infinite number of solutions.
How about b = 0, d equal to any nonzero number, and c equal to any number you want?
1 Comment
Walter Roberson
on 2 Oct 2012
Or
syms x
solve(b * sin(c) - d*sin(x), x)
Walter Roberson
on 2 Oct 2012
0 votes
The ability to use "=" inside solve() was new in R2012a. You will need to use a technique such as shown in Matt's answer if you are using an older version.
Teja Muppirala
on 2 Oct 2012
You're just forgetting the apostrophes
solve('b*sin(c)=d*sin(x)')
ans =
asin((b*sin(c))/d)
pi - asin((b*sin(c))/d)
1 Comment
Teja Muppirala
on 2 Oct 2012
Or, if you want to use symbolic variables, use "==" instead of '='
s = solve(b*sin(y)==c*sin(x),x)
s =
asin((b*sin(y))/c)
pi - asin((b*sin(y))/c)
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!