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개)

Matt Fig
Matt Fig 2012년 10월 2일
편집: Matt Fig 2012년 10월 2일

0 개 추천

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?
Walter Roberson
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
Teja Muppirala 2012년 10월 2일

0 개 추천

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

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에 대해 자세히 알아보기

질문:

seb
2012년 10월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by