필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

solve false answer with a exponential equation

조회 수: 1 (최근 30일)
franco otaola
franco otaola 2016년 10월 12일
마감: MATLAB Answer Bot 2021년 8월 20일
hello i am trying to solve an equation and each time that i try to solve it with the matlab it keeps giving me a false value it doenst give any error or anything... here is the code
syms x
Cf=1;
C_0=10;
M=1.1*1350;
m=155;
thao=M/m;
C=C_0*exp(-x/thao)-Cf;
solve(C,x)
and it keeps giving me the
ans=(297*log(10))/31 %log(10)=1 so, 297/37 that it is aprox 9.56 when the real value is 22.06 aprox
obviusly false. i couldnt find any error or problem in the code. anyone had the same problem?

답변 (1개)

Walter Roberson
Walter Roberson 2016년 10월 12일
log(10) is not 1. log() is natural log. The calculation gives the value you expect. Use vpa() or double() to see the decimal equivalent.
  댓글 수: 2
franco otaola
franco otaola 2016년 10월 12일
thanks, it is really bizarre that it use log() for ln()... i wouldnt expect that...
Walter Roberson
Walter Roberson 2016년 10월 12일
I looked around a few months ago, and I could not find any programming language which used ln() for natural log. All of the major languages I checked used log()

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by