matlab 指数积分

来源:百度知道 编辑:UC知道 时间:2024/05/16 12:08:47
Matlab中函数y=exp(-x) -1.5*exp(2*cos(2*pi*x))在[-1,1]上的积分怎么求

function dy=fun(x,y)
dy=exp(-x) -1.5*exp(2*cos(2*pi*x));
end
%------------以上函数文件,保存名fun.m-------

xx=-1:0.01:1;
syms xi
dy=exp(-xi)-1.5*exp(2*cos(2*pi*xi));
y0=double(subs(dy,0));
[x,y]=ode23('fun',xx,y0);
ddy=subs(dy,x);
plot(x,ddy,x,y,'r')
title('红色为积分函数图')

syms x;
y=exp(-x) -1.5*exp(2*cos(2*pi*x));
y=inline(y);
quad(y,-1,1)

expint

Exponential integral
Syntax

Y = expint(X)
Definitions

The exponential integral computed by this function is defined as

Another common definition of the exponential integral function is the Cauchy principal value integral

which, for real positive x, is related to expint as

Description

Y = expint(X) evaluates the exponential integral for each element of X.
References

[1] Abramowitz, M. and I. A. Stegun. Handbook of Mathematical Functions. Chap