why my figure doesn't show the same logarithmic response like the one in the attached figure?.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/800054/image.png)
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)')
0 commentaires
Réponse acceptée
Dave B
le 14 Nov 2021
Modifié(e) : Dave B
le 14 Nov 2021
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)')
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!