Avoid infinity in the answer
이전 댓글 표시
Hi,
I am trying to run this code and, I always get infinity for my first iteration. Is there a way to avoid that? or at least filter that answers which gives infinity.
for i=1:M %for loop for M repetitions
Nx=N+randn(1,M)*CN; %excitation photon fluctuation
Nt=Nx*10.^-(E*C*l); %Nt = transmitted photons
SD2=sqrt(Nt); %This relationship is only valid for a Poisson distribution.
Nt1=Nt+randn(1,1)*SD2; %Nt = transmitted photon fluctuation
Nt2=mean(Nt1)+sqrt(Nt1)*randn(1,1); %detected photon fluctuation
A(i)=-log(Nt2/Nx); %calculation of absorbance
meanA=mean(A); %mean absorbance signal
standdeviationA=std(A); %noise
SNRUV(i)=meanA/standdeviationA %1/RSD=Signal to noise ratio for absorbance
end
댓글 수: 4
John D'Errico
2019년 2월 9일
It is impossible to answer this. What are the undefined variables? CN, for example? What is N? How about E? C? l?
We cannot help you if you keep it all a secret.
Star Strider
2019년 2월 9일
What are the variable values (‘M’,‘CN’,‘E’), etc.?
Star Strider
2019년 2월 9일
Reiterating:
What are the variable values (‘M’,‘CN’,‘E’), etc.?
Knowing the relevant function arguments is important. We could make wild guesses for them and never come close to the expected values for them.
Chanaka Navarathna
2019년 2월 9일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Photonics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!