How to write a code to solve an equation?

조회 수: 8 (최근 30일)
Matt Ricks
Matt Ricks 2019년 9월 23일
답변: Parthiban Kasi 2021년 6월 21일
I need a matlab code that will solve this equation: x = 0.05t + 8.65ln(1 + (x/8.65)) when "t" is given?
  댓글 수: 2
James Tursa
James Tursa 2019년 9월 23일
What have you done so far? What specific problems are you having with your code? What methods of solving this are you allowed to use?
Matt Ricks
Matt Ricks 2019년 9월 25일
We can use any method of solving but the issue is that I really have no idea how to use matlab but this is the tool we were told to use so that we can use it later in the class

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

답변 (2개)

Fabio Freschi
Fabio Freschi 2019년 9월 25일
편집: Fabio Freschi 2019년 9월 25일
As James Tursa said, the question lacks of information. If it is a homework, I guess you should implement your own algorithm to solve the problem.
Considering matlab built-in functions, it is worth givinge a chance to fsolve
doc fsolve
and play with your function. For example
t = 1; % given value
% your function in the form f(x) = 0
f = @(x)0.05*t + 8.65*log(1 + (x/8.65))-x;
% starting point (maybe you have a better initial guess)
x0 = 1;
% fsolve
xsol = fsolve(f,x0)
Note that fsolve have many inputs and tolerances to play with.

Parthiban Kasi
Parthiban Kasi 2021년 6월 21일

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by