Can integral2 left a variable inside?
Hi,everyone.There’re three variables in my function,x,y and w.
I want to integral x and y first,but there were a variable w stuck in my function.Can I left it and integral x,y first? Thank you.
clear
L=0.1;
section=50;
a=L/2;
b=L/section;
v=3e8;
f1=1.2e9;
f2=4.8e9;
f3=7.5e9;
f4=10e9;
w1=(2*pi*f1);
w2=(2*pi*f2);
w3=(2*pi*f3);
w4=(2*pi*f4);
Z01=50;
Z02=75;
a0=(log(Z02/Z01))./(2.*L);
T=a;
Ub=a;
Lb=-a;
ub=a;
lb=-a;
k=6;
syms x y w
l=0:(2*L)/(2*k):L % Approximate sections dvided
sec=numel(l)-1;
% Cm0
for s=1:1:sec
for t=1:1:sec
for m=1:1:k
P1=matlabFunction(((cos((m.*pi.*(y))./a)).*(cos(2.*(x-y).*w./v))));
P2(1,m)=integral2(P1,Lb+l(s),Lb+l(s+1),Lb+l(t),@(x)x);
P3(1,m)=integral2(P1,Lb+l(s),Lb+l(s+1),@(x)x,Lb+l(t+1));
P{s,t}=(P2+P3) % s section multiply t section
end
endHi,everyone.There’re three variables in my function,x,y and w.
I want to integral x and y first,but there were a variable w stuck in my function.Can I left it and integral x,y first? Thank you.
clear
L=0.1;
section=50;
a=L/2;
b=L/section;
v=3e8;
f1=1.2e9;
f2=4.8e9;
f3=7.5e9;
f4=10e9;
w1=(2*pi*f1);
w2=(2*pi*f2);
w3=(2*pi*f3);
w4=(2*pi*f4);
Z01=50;
Z02=75;
a0=(log(Z02/Z01))./(2.*L);
T=a;
Ub=a;
Lb=-a;
ub=a;
lb=-a;
k=6;
syms x y w
l=0:(2*L)/(2*k):L % Approximate sections dvided
sec=numel(l)-1;
% Cm0
for s=1:1:sec
for t=1:1:sec
for m=1:1:k
P1=matlabFunction(((cos((m.*pi.*(y))./a)).*(cos(2.*(x-y).*w./v))));
P2(1,m)=integral2(P1,Lb+l(s),Lb+l(s+1),Lb+l(t),@(x)x);
P3(1,m)=integral2(P1,Lb+l(s),Lb+l(s+1),@(x)x,Lb+l(t+1));
P{s,t}=(P2+P3) % s section multiply t section
end
end Hi,everyone.There’re three variables in my function,x,y and w.
I want to integral x and y first,but there were a variable w stuck in my function.Can I left it and integral x,y first? Thank you.
clear
L=0.1;
section=50;
a=L/2;
b=L/section;
v=3e8;
f1=1.2e9;
f2=4.8e9;
f3=7.5e9;
f4=10e9;
w1=(2*pi*f1);
w2=(2*pi*f2);
w3=(2*pi*f3);
w4=(2*pi*f4);
Z01=50;
Z02=75;
a0=(log(Z02/Z01))./(2.*L);
T=a;
Ub=a;
Lb=-a;
ub=a;
lb=-a;
k=6;
syms x y w
l=0:(2*L)/(2*k):L % Approximate sections dvided
sec=numel(l)-1;
% Cm0
for s=1:1:sec
for t=1:1:sec
for m=1:1:k
P1=matlabFunction(((cos((m.*pi.*(y))./a)).*(cos(2.*(x-y).*w./v))));
P2(1,m)=integral2(P1,Lb+l(s),Lb+l(s+1),Lb+l(t),@(x)x);
P3(1,m)=integral2(P1,Lb+l(s),Lb+l(s+1),@(x)x,Lb+l(t+1));
P{s,t}=(P2+P3) % s section multiply t section
end
end integral2 MATLAB Answers — New Questions