?? simp.m
字號(hào):
%simp.m
function simpu=simp(f,inc)
%Simpson's rule for numerical integration
%f is an odd array of evaluated functions in steps inc
ip=length(f); %must be an odd number
s1=sum(f(2:2:ip-1));%sums all even terms
s2=sum(f(3:2:ip-2));%sums all odd term does not include f(1) and f(ip)
simpu=(4.*s1+2.*s2+f(1)+f(ip))*inc/3.0;%finally add f(1) and f(ip)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -