function z = zernpol(n,m,r,nflag) dCinbAQ
%ZERNPOL Radial Zernike polynomials of order N and frequency M. WA<~M)rb
% Z = ZERNPOL(N,M,R) returns the radial Zernike polynomials of MT3UJ6 ~P
% order N and frequency M, evaluated at R. N is a vector of *2 [r?!
% positive integers (including 0), and M is a vector with the Dx8^V%b
% same number of elements as N. Each element k of M must be a jWm<!<~
% positive integer, with possible values M(k) = 0,2,4,...,N(k) p4/D%*G^`
% for N(k) even, and M(k) = 1,3,5,...,N(k) for N(k) odd. R is /rquI y^
% a vector of numbers between 0 and 1. The output Z is a matrix J[^-k!9M
% with one column for every (N,M) pair, and one row for every CkOd>Kn
% element in R. \X(.%5xC
% m$U2|5un&
% Z = ZERNPOL(N,M,R,'norm') returns the normalized Zernike poly- p}h)WjC
% nomials. The normalization factor Nnm = sqrt(2*(n+1)) is ?&[`=ZVn
% chosen so that the integral of (r * [Znm(r)]^2) from r=0 to Ts.61Rx
% r=1 is unity. For the non-normalized polynomials, Znm(r=1)=1 H#f
FU
% for all [n,m]. n|8fdiK#}
% 5y.kOe4vH
% The radial Zernike polynomials are the radial portion of the ZN.
#g_
% Zernike functions, which are an orthogonal basis on the unit oR5 'g7?
% circle. The series representation of the radial Zernike s8R.?mhH=
% polynomials is PJ);d>tz
% NZv1dy`fa
% (n-m)/2 1%>/%eyn5
% __ IF<jq\M
% m \ s n-2s H=*;3gM,'
% Z(r) = /__ (-1) [(n-s)!/(s!((n-m)/2-s)!((n+m)/2-s)!)] * r iZ&