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.

답변 (1개)

madhan ravi
madhan ravi 2018년 10월 31일

1 개 추천

Remove all clear commands from the loop and see

댓글 수: 1

Abhishek mani shukla
Abhishek mani shukla 2018년 10월 31일
thanks for your suggestion but its not working.

댓글을 달려면 로그인하십시오.

카테고리

제품

릴리스

R2017a

질문:

2018년 10월 31일

댓글:

2018년 10월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by