📄 xsingularint.m
字号:
function xSingularInt
% 奇异函数的积分例子
% An Example of Integration of a Singular function f(x) from a to b
% by using QUAD(adaptive Simpson quadrature)and QUADL(adaptive Lobatto quadrature)
%
% Author: HUANG Huajiang
% Copyright 2002 UNILAB Research Center,
% East China University of Science and Technology, Shanghai, PRC
% $Revision: 1.0 $ $Date: 2002/05/9 $
clear all
clc
% the interval: [a, b], the step: d
a = 0;
b = 1;
d = pi/50;
t = a:d:b;
y = func(t);
format long
% 自适应Simpson法(Adaptive Simpson quadrature, low order)
y_quad = quad(@func,a,b)
% 自适应Lobatto求积法(Adaptive Lobatto quadrature, high order)
y_quadl = quadl(@func,a,b)
% ------------------------------------------------------------------
function y = func(t) % 奇异函数(Singular function)
y = 1./(t.^(1/2)+t.^(1/3));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -