MATLAB: I just have one simple question. How do i calculate the integral of this area

integration

r=@(z)2+sin(5*z+2.2*cos(5*z));
z=linspace(0,2*pi);
x=r(z).*cos(z);
y=r(z).*sin(z);
plot(x,y)

Best Answer

One approach:
r=@(z)2+sin(5*z+2.2*cos(5*z));
z=linspace(0,2*pi);
x=r(z).*cos(z);
y=r(z).*sin(z);
Ixy = cumtrapz(z, abs(r(z)));
Check = max(abs(r(z)))^2 * pi; % Area Must Be Less Than Maximum Circle Area
plot(x,y)
axis equal
text(0, 0, sprintf('Area = %.2f', Ixy(end)), 'HorizontalAlignment','center', 'VerticalAlignment','middle')