<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/* BananaFunction.java
 * This file is used as an example for the MATLAB
 * Java Package product.
 *
 * Copyright 2001-2007 The MathWorks, Inc.
 */

public class BananaFunction {
	public BananaFunction() {}
	public double evaluateFunction(double[] x)
	{
		/* Implements the Rosenbrock banana function described in 
		 * the FMINSEARCH documentation
		 */
		double term1 = 100*java.lang.Math.pow((x[1]-Math.pow(x[0],2.0)),2.0); 
		double term2 =  Math.pow((1-x[0]),2.0);
		return term1 + term2;
	}

}
</pre></body></html>