How can I plot the graph of this double integral function in Matlab?

조회 수: 11(최근 30일)
I'm trying to plot the a graph of eta against r but I'm getting errors.
r = linspace(10^-2,10^2);
for delta = [1 2 3 4 5 6]
f=@(x,y) x.*exp(-3.44.*r.^(5./3).*x.*(sin(y./2)).^(5./3)).*cos(delta.*y);
eta = integral2(f,0,1,0,2*pi);
plot(r,eta)
loglog(r,eta)
end
How can i plot the graph of the integral? Thanks in advance!

채택된 답변

David Hill
David Hill 2022년 9월 28일
r = linspace(10^-2,10^2);
eta=zeros(size(r));
hold on;
for delta= [1 2 3 4 5 6]
for k=1:numel(r)
f=@(x,y) x.*exp(-3.44.*r(k).^(5/3).*x.*(sin(y/2)).^(5/3)).*cos(delta*y);
eta(k) = integral2(f,0,1,0,2*pi);
end
plot(r,eta)
end

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by