I want to solve a sinus equation.
Mostrar comentarios más antiguos
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
Respuestas (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 comentario
Walter Roberson
el 2 de Oct. de 2012
Or
syms x
solve(b * sin(c) - d*sin(x), x)
Walter Roberson
el 2 de Oct. de 2012
0 votos
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
el 2 de Oct. de 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 comentario
Teja Muppirala
el 2 de Oct. de 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)
Categorías
Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!