Performing a Double Integration

4 views (last 30 days)
I'm trying to find the area of a deformed circle using the following code:
% Perimeter Area of the Circle
Beta = 0.2
fun3 = @(x,y) (sqrt( (((1 + 6*Beta)*cos(x) - 6*Beta*sin(x) + 3*Beta*cos(2*x))^2) + (((1+2*Beta)*sin(x) - 2*Beta*cos(x) - Beta*cos(2*x))^2)));
xmin = 0;
xmax = 2*pi;
ymin = 0;
ymax = 1;
Perimeter_Area_of_Circle = integral2(fun3,xmin,xmax,ymin,ymax)
I keep getting several erros when I try to execute this and I can't figure out what I'm doing wrong.
Thanks!

Accepted Answer

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 11 Oct 2019
Hi,
Here is the corrected code of yours:
Beta = 0.2;
fun3 = @(x,y) (sqrt( (((1 + 6*Beta)*cos(x) - 6*Beta*sin(x) + 3*Beta*cos(2*x)).^2) + (((1+2*Beta)*sin(x) - 2*Beta*cos(x) - Beta*cos(2*x)).^2)));
xmin = 0;
xmax = 2*pi;
ymin = 0;
ymax = 1;
Perimeter_Area_of_Circle = integral2(fun3,xmin,xmax,ymin,ymax)
Good luck.

More Answers (0)

Categories

Find more on Simulink 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!