Why isn't my integration using Trapezoidal Rule working?
Show older comments
Hi,
I am a newbie at matlab and was wondering why the following code was not working. The problem is asking me to integrate using trapezoidal rule/method for this function.

The code I wrote was:
x = pi/4:2:pi/3; y = x./((sin(x)).^2); z = trapz(x, y);
When I run the code, I get the following errors:
Error in trapz (line 43) y = permute(y,perm);
Error in assignmenttesting (line 3) z = trapz(x, y);
Please help
Accepted Answer
More Answers (0)
Categories
Find more on Numerical Integration and Differentiation 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!