Solve inequation not working with sqrt
조회 수: 2 (최근 30일)
이전 댓글 표시
I tried to solve a simple inequation that had square root of the variable and the solve() function is not giving me the correct answer.
The inequation is: ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/368023/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/368023/image.png)
The code is:
clear;
syms k real
eq = ( -1 + sqrt(1-4*k) )/2 < 1;
solve(eq, k)
And the answer is 0.
Since k is real the answer should be the interval (-2, 1/4)
댓글 수: 0
채택된 답변
Prudhvi Peddagoni
2020년 10월 1일
Hi,
It seems that you did not enable ReturnConditions parameter. So the function is returning only one solution
solve(eq, k,'ReturnConditions',true);
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Specialized Power Systems에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!