필터 지우기
필터 지우기

why my figure doesn't show the same logarithmic response like the one in the attached figure?.

조회 수: 1 (최근 30일)
figure
%set(gca, 'XScale', 'log')
%set(gca, 'YScale', 'log')
ylim ([0 16])
APD=linspace(0,2);
%APD=0:0.5:2;
for ii=1:3
if ii == 1
f=25.4;
color = 'k';
style='-';
linewidth = 2;
hold on
elseif ii == 2
f=35;
color = 'b';
style = '-';
linewidth = 2;
elseif ii == 3
f=50;
color = 'g';
style = '-';
linewidth = 2;
end
phi_SAFOV = atand((APD.*10^-4)./(2*f*10^-3));
set(gca,'XTICK',[ 0 0.5 1 1.5 2 ]);
set(gca,'YTICK',[ 0 2 4 6 8 10 12 14 16 ]);
plot(APD,phi_SAFOV,'Color',color,'LineStyle',style,'linewidth',linewidth);
lgd = legend('f=25.4 mm','f=35.0 mm','f=50.0 mm','off');
end
hold off
xlabel('Surface area of PD (cm^2)')
ylabel('\oslash_v_e_r or \oslash_h_o_r (^o)')

채택된 답변

Dave B
Dave B 2021년 11월 14일
편집: Dave B 2021년 11월 14일
I'm not sure how to match the y axis values, your equation didn't have much info about DPD, but it looks to me like you're missing a sqrt (maybe because the x axis is cm^2?)
(In any case I cleaned up your code :) )
x=linspace(0,2);
f=[25.4 35 50];
phi_SAFOV = atand(sqrt(x)./(2*f'));
plot(x,phi_SAFOV,'linewidth',2);
colororder(diag([1 1 1]))
legend('f=25.4 mm','f=35.0 mm','f=50.0 mm','Location','north');
xlabel('Surface area of PD (cm^2)')
ylabel('\oslash_{ver} or \oslash_{hor} (^o)')
  댓글 수: 1
ORION OMN
ORION OMN 2021년 11월 16일
I missed the sqrt, it works well now with "ylim ([0 16])".
Thank you for your time and for cleaning my code. ^-^

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by