trapuneq (unequal spaced trapezoidal rule quadrature)

2 ビュー (過去 30 日間)
Ahzabuddin
Ahzabuddin 2016 年 5 月 19 日
コメント済み: Walter Roberson 2023 年 4 月 14 日
Hi... I hope that I can solve a problem about trapenuq formula
x = [0 .12 .22 .32 .36 .4 .44 .54 .64 .7 .8];
y = 0.2+25*x-200*x.^2+675*x.^3-900*x.^4+400*x.^5;
trapuneq(x,y)
??? Undefined function or variable 'l'.
Error in ==> trapuneq at 18 s = s + (x(k+l)-x(k))*(y(k)+y(k+l))/2;
thanks

回答 (1 件)

Sam
Sam 2023 年 4 月 14 日
Changing the 2 "l"s ("L"s; Capital shown for variable clarity) to a "1" ("One") in the line of the For loop fixes the error and allows the same anser to be attained as shown in the textbook (1.5948).

カテゴリ

Help Center および File ExchangePolygons についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by