How can i solve and input this problem

조회 수: 1 (최근 30일)
Nate
Nate 2022년 7월 5일
댓글: Image Analyst 2022년 7월 13일
e^x=8x-4 in MATLAB. It says to find all real solutions.
  댓글 수: 3
Star Strider
Star Strider 2022년 7월 5일
Please visit MATLAB Academy.
One option is:
syms x
f = exp(x) == 8*x-4
f = 
xval = solve(f)
xval = 
I leave the rest to you!
.
Image Analyst
Image Analyst 2022년 7월 13일
Original question (I think) in case he edits it away like some others:
e^x=8x-4 in MATLAB. It says to find all real solutions.

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

답변 (2개)

Mann Baidi
Mann Baidi 2022년 7월 5일
Hi Nathaniel,
If you want to find the real solutions of a equation, we can use the function solve()
For the above equation, the code for finding the real solutions should be :
For knowing more about the solve() function you can go through the doumentation.
syms x % Declare x as variable in the equation
eqn= exp(1)^x==8*x-4; % State the equation exp(1) denotes e
sol= solve(eqn,x,'Real',true); % using the solve function and keeping real as true
disp(sol); % sol are the real solutions of the equation

Sam Chak
Sam Chak 2022년 7월 5일
I use a different example,
so that you can try to work on the solution yourself.
fun = @(x) exp(x) - (6*x.^2 - 3);
fplot(fun, [-1 5], 'linewidth', 2), grid on, xlabel('x')
x0 = -1;
xsol1 = fzero(fun, x0)
xsol1 = -0.7602
x0 = 1.5;
xsol2 = fzero(fun, x0)
xsol2 = 0.9692
x0 = 5;
xsol3 = fzero(fun, x0)
xsol3 = 4.9838

카테고리

Help CenterFile Exchange에서 Numbers and Precision에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by