?? 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 + -