public static double [ ] xVals ( double [ ] vector ) { if ( vector == null ) return null ; double [ ] x = new double [ vector . length / 2 ] ; int count = 0 ; for ( int i = 0 ; i < vector . length ; i ++ ) { if ( i % 2 != 0 ) x [ count ++ ] = vector [ i ] ; } return x ; }
This returns the x values of the given vector . These are assumed to be the even values of the vector .