필터 지우기
필터 지우기

How can I find the two intersection points of the x and y axis of two equations in Matlab?

조회 수: 2 (최근 30일)
I need to find the two intersection points of the x,y axis of x^2 and log(x+1), I have tried it with the solve command and it does not work.

채택된 답변

Walter Roberson
Walter Roberson 2023년 10월 29일
Example with deliberately different equations. You can study the techniques and appy them to your own code.
syms x y
eqn1 = y == 5*x^3;
eqn2 = y == log(x^2-2*x-1);
yintercept1 = solve(subs(eqn1, y, 0), 'returnconditions', true)
yintercept1 = struct with fields:
x: [3×1 sym] parameters: [1×0 sym] conditions: [3×1 sym]
yintercept1.x
ans = 
yintercept1.conditions
ans = 
yintercept2 = solve(subs(eqn2, y, 0), 'returnconditions', true)
yintercept2 = struct with fields:
x: [2×1 sym] parameters: [1×0 sym] conditions: [2×1 sym]
yintercept2.x
ans = 
xintercept1 = solve(subs(eqn1, x, 0), 'returnconditions', true)
xintercept1 = struct with fields:
y: 0 parameters: [1×0 sym] conditions: symtrue
xintercept2 = solve(subs(eqn2, x, 0), 'returnconditions', true)
xintercept2 = struct with fields:
y: pi*1i parameters: [1×0 sym] conditions: symtrue

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by