Calculate the Natural logarithm ln
조회 수: 20 (최근 30일)
이전 댓글 표시
I'm trying to calculate the natural log of temperature and pressure ratio for an ideal gas in order to find the entropy change.
I've read some articles that says it's the same thing as log(x), but that doesn't make any sense.
I have some literture data to compare with. Using log(x) gives me incorrect values.
Is there a way to use the natural log ln in MATLAB?
댓글 수: 3
Irma Espinoza
2019년 12월 9일
I have the same problem, I'm trying to get natural logarithm of vector STR1, please see below.The result I get for each of the elements is incorrect, for example, element 1 is 1.00001626396027 , the natural logaritm I get from matlab is 0.016263828016221, the result I get from excel and other methods is 0.0000162638280133342.
for n=1:finish
STR11(n)=log(STR1(1,n))
end
Steven Lord
2019년 12월 9일
Make sure you're using the version of the log function included in MATLAB, not one you've written or obtained elsewhere.
which -all log
Can you show us the output of that command? This should list two built-in functions and (depending on which toolboxes you have installed) a few others all under the toolbox subdirectory of matlabroot.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!