📄 midpointc.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -