필터 지우기
필터 지우기

Hi all,I want to use matlab to calculate the exponential integral,I know that the official function ExpIntegralE in Mathematica can calculate it.

조회 수: 10 (최근 30일)
As shown in the title, I want to find a relatively authoritative code to calculate exponential integral

채택된 답변

Paul
Paul 2022년 8월 31일
ExpIntegralE in Mathematica seems to be the same as the two-argument form of expint in the Symbolic Math Toolbox.
  댓글 수: 2
Paul
Paul 2022년 9월 4일
"there is no official matlab function that is used like expint(n,x), in matlab "
Using the function at the doc page for expint linked above in this Answer
expint(sym(3),sym(5.5))
ans = 
Get the decimal representation
vpa(expint(sym(3),sym(5.5)))
ans = 
0.00049877076767550924005965009248623
which is the same result using ExpIntegalE in Mathematica link

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

추가 답변 (1개)

John D'Errico
John D'Errico 2022년 8월 30일
편집: John D'Errico 2022년 8월 30일
Is there a reason why you would not just use expint?
help expint
EXPINT Exponential integral function. Y = EXPINT(X) is the exponential integral function for each element of X. The exponential integral is defined as: EXPINT(x) = integral from x to Inf of (exp(-t)/t) dt, for x > 0. By analytic continuation, EXPINT is a scalar-valued function in the complex plane cut along the negative real axis. Another common definition of the exponential integral function is the Cauchy principal value integral from -Inf to X of (exp(t)/t) dt, for positive X. This is denoted as Ei(x). The relationships between EXPINT(x) and Ei(x) are as follows: EXPINT(-x+i*0) = -Ei(x) - i*pi, for real x > 0 Ei(x) = REAL(-EXPINT(-x)), for real x > 0 Class support for input X: float: double, single Documentation for expint doc expint Other functions named expint codistributed/expint gpuArray/expint sym/expint
Probably you did not look for it. And that was what you did wrong. When you don't know how to do something in MATLAB, LEARN TO USE LOOKFOR. In my case, this identified many possible things, but do you see the 6th item on the list?
lookfor exponential
expmdemo1 - Matrix exponential via Pade approximation.
expmdemo2 - Matrix exponential via Taylor series.
expmdemo3 - Matrix exponential via eigenvalues and eigenvectors.
exp - Exponential.
expm - Matrix exponential.
expint - Exponential integral function.
...
Any guesses what expint would do? The point is, USE LOOKFOR.
  댓글 수: 6
ma Jack
ma Jack 2022년 9월 4일
In fact, there is no official matlab function that is used like expint(n,x), in matlab it can only be expint(x), which is equivalent to ExpIntegralE[1, x] in mathematica, but what I want is ExpIntegralE[n, x]
Walter Roberson
Walter Roberson 2022년 9월 4일
https://www.mathworks.com/help/symbolic/expint.html is not part of MATLAB???

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

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by