How to Increase plotting speed
Show older comments
Hi everyone,I have a big trouble on plotting my results,it took a long time to complete the figure.Is there any method to increase plotting speed?
Thanks for your help!!!
clear
L=0.1;
a=L/2;
v=3e8;
f1=1.2e9;
f2=4.8e9;
f3=10e9;
w1=(2*pi*f1);
w2=(2*pi*f2);
w3=(2*pi*f3);
Z01=50;
Z02=50;
a0=(log(Z02/Z01))./(2.*L);
T=2*a;
k=1;
syms x y w
Am=-5;
%%% Eight section SFG
% Calculate gamma
s=L/8;
for n=1:1:k
V=Am(n);
P_am=((V*cos(n*pi*x/T)))*(exp(-2*1i*(w/v)*x));
P_am_int1(n)=int(P_am,x,[0 s]);
P_am_int2(n)=int(P_am,x,[s 2*s]);
P_am_int3(n)=int(P_am,x,[2*s 3*s]);
P_am_int4(n)=int(P_am,x,[3*s 4*s]);
P_am_int5(n)=int(P_am,x,[4*s 5*s]);
P_am_int6(n)=int(P_am,x,[5*s 6*s]);
P_am_int7(n)=int(P_am,x,[6*s 7*s]);
P_am_int8(n)=int(P_am,x,[7*s 8*s]);
end
Ga1=sum(P_am_int1);
Ga2=sum(P_am_int2);
Ga3=sum(P_am_int3);
Ga4=sum(P_am_int4);
Ga5=sum(P_am_int5);
Ga6=sum(P_am_int6);
Ga7=sum(P_am_int7);
Ga8=sum(P_am_int8);
Ga=[Ga1 Ga2 Ga3 Ga4 Ga5 Ga6 Ga7 Ga8];
Ta=1-((Ga(7:-1:1)).^2);
%%% SFG
section_num=8;
gamma_app8=Ga(section_num);
for m=1:1:section_num-1
gamma_app8=gamma_app8*((Ta(section_num-m)))/(1+abs((gamma_app8*Ga(section_num-m))));
gamma_app8=gamma_app8+Ga(section_num-m);
end
fplot(w,abs(gamma_app8),[0 w3],'-','LineWidth',3)
Accepted Answer
More Answers (0)
Categories
Find more on Manage Products 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!