trapuneq (unequal spaced trapezoidal rule quadrature)
2 views (last 30 days)
Show older comments
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
Answers (1)
Sam
on 14 Apr 2023
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).
0 Comments
See Also
Categories
Find more on Polygons in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!