function Zz = RosenbrocknDF(X)
% RosenbrocknDF.m
% n-dimensional Rosenbrock's function created for DE
% X is an n by np matrix where
% n is the number of parameters &
% np is the population size.
% K. Ming Leung, 10/04/03

XX = X(1:end-1,:); XXSQUARE = XX.*XX;
XX2 = X(2:end,:);
Zz = sum(100*(XXSQUARE-XX2).^2+(1-XX).^2,1);
% the 1 is needed in the above line 
% in order for the n=2 case to work
