Write a function that is called like this: mbd = spherical_​mirror_abe​rr(fn,D), where all arguments are scalars, fn is the “f-number” of a concave spherical mirror, D is its diameter in millimeters, and mbd is the mean blur diameter in millimeters. Th

1 次查看(过去 30 天)
I am getting problem in answer please help me to find it.
function mbd= spherical_mirror_aberr(fn,D)
format long
f= fn.*D;
Delta_x= 0.01;
x= 0:Delta_x:D/2;
theta= asin(x/2.*f);
d= 2.*f.*tan(2.*theta).*((1./cos(theta))-1);
mbd= (((8.*Delta_x)/D^2).* sum(x(:).*d(:)));
end
ans for (8,152) is 0.029743954651679 but i am not getting this.

回答(1 个)

Ankit Bhatnagar
Ankit Bhatnagar 2017-5-16
Hi,
Use ./ for your divisions and .* for your multiplications.

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by