📄 newtcotes.m
字号:
%% newtcotes.m %% Compute the weights of the Newton-Cotes quadrature quadrature% on [0,1] with equidistant nodes.%%n = input(' Number n+1 of quadrature nodes n = ');% nodes h = 1/n;x = (0:h:1)';% the transpose of the system matrix A = ones(n+1,n+1);for i = 1:n A(:,i+1) = A(:,i).*x;end% right hand sided = 1./(1:n+1)';% Newton-Cotes quadrature weightsw = A'\d;disp(' Newton-Cotes quadrature weights ')disp(w')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -