function y = Cnk(n,v)
% vector verstion of n choose k
% Usage:: Cnk=(n,k)
%
% Cnk=n!/[(n–k)!k!] is a vector the same size as k. n is scalar

% revision history:
% 08/12/98 Mark D. Shattuck <mds>   Cnk.m
% 12/09/14 mds add allow v to be matrix

Nv=numel(v);
y=zeros(size(v));
for m=1:Nv
  y(m)=nchoosek(n,v(m));
end

