MATLAB: Find data in specific range

solar declination

Dear all,
I'm quite new in using Matlab. I've wrote a script to determine estimation of solar declination, sd by day number, dn. I would like to know how I can find and fprintf on which dn when -0.2<= sd <= 0.2 with script below. Please help me
fout = fopen('Project_2_Matlab.res','w');
% day number, dn
dn = [1:1:365];
% Solar declination, sd
sd = 23.45*sind(360*(dn+284)/365);
for i=1:1:36
j=i*10;
fprintf(fout,'%3d %3.3f \n',j, sd(j));
end

Best Answer

out = dn(sd >= -.2 & sd <= .2);