expint not functioning as expected?

조회 수: 18 (최근 30일)
J
J 2011년 3월 29일
Hi all,
I am trying to use expint in a routine I am coding, however it doesn't seem to be working as I expect it to. I expect it to function as shown by the link below
With the output starting negative then becoming positive around 0.372. Have I misunderstood what this function does?
I am using the command below to check output:
>> plot(expint(0:0.01:1.5))
Thanks,
J

채택된 답변

Matt Fig
Matt Fig 2011년 3월 29일
I think perhaps you are looking for this:
Ei = @(x)real(-expint(-x));
x = -2:0.001:3;
plot(x,Ei(x))
  댓글 수: 2
J
J 2011년 3월 29일
So effectively I was just assuming to see the real part of the answer? Just me being stupid again then...
Matt Fig
Matt Fig 2011년 3월 29일
You probably confused one definition of the exponential integral for the other. Read the doc for EXPINT carefully.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by