Fast Trapezoidal Integration

版本 1.0.0.0 (3.1 KB) 作者: Umberto Picchini
Similar to TRAPZ but (up to) 16x-times faster. Equally spaced data NOT required.
3.5K 次下载
更新时间 2006/10/13

无许可证

F=trapzf(X,Y) computes the integral of Y with respect to X using the trapezoidal method. X and Y must be vectors of the same length.
For trapzf to work properly:
X must be a STRICTLY monotonically increasing vector.

Example:
>> x=[1:1:1000];
>> y=log(sqrt(x+1.001)-1.001);
>> area=trapzf(x,y);

Warning: not much in the way of error checking, since this slows things down, so pay attention to the argument passed to the function!!!

Installation (Windows users):
------------------------------

Simply copy the trapzf.dll file in a directory recognizable by MATLAB. You won't need trapzf.c to perform computations, but it is useful if you want to read the user instructions or to customize your code.
If you modify trapzf.c then you must run the following command

mex trapzf.c

in order to obtain the new dll file.

Installation (other OS users):
-------------------------------

A precompiled c-mex file is not provided.
You have to compile trapzf.c with your favourite C compiler (write "mex -setup" at the MATLAB prompt), then write

mex trapzf.c

in order to obtain the corresponding mex-file (see the table below)

OS ---> Extension
------------------------------
sol2, SunOS 5.x ---> .mexsol
hpux ---> .mexhpux
hp700 ---> .mexhp7
ibm_rs ---> .mexrs6
sgi ---> .mexsg
alpha ---> .mexaxp
glnx86 ---> .mexglx

PLEASE RATE MY SUBMISSION!

引用格式

Umberto Picchini (2024). Fast Trapezoidal Integration (https://www.mathworks.com/matlabcentral/fileexchange/8644-fast-trapezoidal-integration), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R13
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0

old dll file substitute with a dll created using the LCC compiler