I want to solve a sinus equation.
이전 댓글 표시
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
답변 (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
Walter Roberson
2012년 10월 2일
Or
syms x
solve(b * sin(c) - d*sin(x), x)
Walter Roberson
2012년 10월 2일
0 개 추천
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
2012년 10월 2일
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
Teja Muppirala
2012년 10월 2일
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)
카테고리
도움말 센터 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!