midpointc.m

来自「sareli<matlab科学计算>配套程序」· M 代码 · 共 11 行

M
11
字号
function Imp=midpointc(a,b,M,f)%MIDPOINTC Composite midpoint numerical integration.%   IMP = MIDPOINTC(A,B,M,FUN) computes an approximation of the integral %   of the function FUN via the midpoint method (with M equispaced intervals).%   FUN accepts real scalar input x and returns a real scalar%   value. FUN can also be an inline object.H=(b-a)/M; x = linspace(a+H/2,b-H/2,M);fmp=feval(f,x); Imp=H*sum(fmp);return

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?