Trying to Solve quadratic inequalities

조회 수: 4 (최근 30일)
Athanasios Paraskevopoulos
Athanasios Paraskevopoulos 2023년 12월 31일
댓글: Athanasios Paraskevopoulos 2023년 12월 31일
Hello, I am a new user of Matlab and I am trying to solve the following inequality
I tried to solve it with the code bellow and as you can see the result is wrong. I am seeking for intervals. What should I do?
syms x
ineq = x^2-2*x+7>12;
sol = solve(ineq, x)
sol = 

채택된 답변

Torsten
Torsten 2023년 12월 31일
편집: Torsten 2023년 12월 31일
Don't expect that MATLAB succeeds for complicated systems of quadratic inequalities. But for this simple one, it returns a solution:
syms x
ineq = x^2-2*x+7>12;
sol = solve(ineq, x, 'ReturnConditions',1);
sol.conditions
ans = 
  댓글 수: 1
Athanasios Paraskevopoulos
Athanasios Paraskevopoulos 2023년 12월 31일
Thank you very much. I am a mathematician and I would like to put in my teaching some examples through Matlab. I am exploring what possibilities this program can give me and at the same time learn to use it for my PhD.

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

추가 답변 (1개)

John D'Errico
John D'Errico 2023년 12월 31일
편집: John D'Errico 2023년 12월 31일
syms x
ineq = x^2-2*x+7>12;
sol = solve(ineq, x,'returnconditions',true)
sol = struct with fields:
x: [2×1 sym] parameters: x conditions: [2×1 sym]
sol.x
ans = 
sol.conditions
ans = 
The result is two half-infinite intervals.

카테고리

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

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by