필터 지우기
필터 지우기

Solve function

조회 수: 1 (최근 30일)
lina
lina 2012년 5월 18일
Hi Everyone,
I need to find the value of xgaris1
dis1=1.5;
newx=3;
newy=2;
xgaris1= solve('dis1^2=abs(sqrt(xgaris1-newx)^2+((3-xgaris1)-newy)^2)');
but the output of xgaris1 always didn't calculate the numeric value of dis1, newx, and newy as seen below: xgaris1 = (4*dis1^2 + 4*newx + 4*newy - 11)^(1/2)/2 - newy + 5/2 5/2 - (4*dis1^2 + 4*newx + 4*newy - 11)^(1/2)/2 - newy
For any reply, will very appreciate.
Thanks in advance, Lina

채택된 답변

Walter Roberson
Walter Roberson 2012년 5월 18일
Convert solve('A=B') to solve((A)-(B)) with no quotes. But
syms xgaris1
first.
  댓글 수: 2
lina
lina 2012년 5월 18일
Hi Walter,
thanks for the reply..
I've tried as your suggestion, but have some errors below :
>> clear
dis1=1.5;
newx=3;
newy=2; syms xgaris1;
solve((dis1^2)=(abs(sqrt(xgaris1-newx)^2+((3-xgaris1)-newy)^2)))
solve((dis1^2)=(abs(sqrt(xgaris1-newx)^2+((3-xgaris1)-newy)^2)))
|
Error: The expression to the left of the equals sign is not a valid
target for an assignment.
>> clear
dis1=1.5;
newx=3;
newy=2; syms xgaris1;
xgaris1=solve((dis1^2)=(abs(sqrt(xgaris1-newx)^2+((3-xgaris1)-newy)^2)))
xgaris1=solve((dis1^2)=(abs(sqrt(xgaris1-newx)^2+((3-xgaris1)-newy)^2)))
|
Error: The expression to the left of the equals sign is not a valid
target for an assignment.
Walter Roberson
Walter Roberson 2012년 5월 18일
(A) MINUS (B)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by