How to make this loop fast.
Mostrar comentarios más antiguos
I want to optimised the below given code,
for I=1:1*10^5
y1=Mod_sig*h(1,I)*Theta(1,I);
rx=y1+1*Noise(no_of_points, Nsp,Gain_edfa,h_p,Nu,B);
clear y1
rx_fft=fftshift(fft(rx));
clear rx
obpf_opfd=OBPF.*rx_fft;
clear rx_fft
Obpf_optd=ifft(ifftshift(obpf_opfd));
clear obpf_opfd
De_mod=Delay_demodulation(Obpf_optd,samples_per_bit);
clear Obpf_optd
Elpf_op= lowpass_bessel_filter_output(order,cutoff_frequency,De_mod,Fs);
clear De_mod
Samp_sel=Elpf_op(:,4:samples_per_bit:end);
clear Elpf_op
Th_op=Samp_sel>0;
error=sum(sum(data1~=Th_op));
Err=[Err error];
end
its taking a lot of time.
Respuestas (1)
madhan ravi
el 31 de Oct. de 2018
1 voto
Remove all clear commands from the loop and see
1 comentario
Abhishek mani shukla
el 31 de Oct. de 2018
Categorías
Más información sobre Solver Outputs and Iterative Display en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!