O()

function out=O(in)

Input:

Global variables:

Output:

To produce a function of the above prototype, copy the program in Appendix D into the file ``$\sim$/A1/O.m'' and replace the ``...'' on the line labeled ``YOUR CODE HERE'' with code to compute out according to the definition of the O() operator in the function specification given above.

Hints: Don't forget that, to access R, you will need to use the variable name gbl_R. Also, be sure to include a semicolon at the end of your line for computing out. Otherwise, you'll be plagued by a large printout of your results! Finally, be more clever in your implementation than wasting lots of time and space by actually forming the matrix ${\bf O}$ explicitly and then multiplying by it - your only responsibility is to make sure that the return value of O() is correct!!!

To verify your O() operator, execute the following at the octave prompt (after running your new ``setup.m'', of course),

in=randn(10,1) %# Create a random (normally distributed) 10x1 column vector
out=O(in); %# Apply O to in and store result in out
out./in %# Check ratio of each element of out to each element of in
det(R) %# Compare to det(R)

Tomas Arias 2006-04-05