Both L() and K() are diagonal operators based on the values of G2. We
thus need only check whether the input has a size corresponding to G2
or G2c and to then use the values from the corresponding array. This
can be accomplished by adding the statement ``global gbl_G2c'' to the
top of each of the above functions and employing statements along the
lines of ``if size(in,1)==length(gbl_G2c)'' with copies of your code
with G2 replaced by G2c. (Be sure to keep your code functioning for
the case ``size(in,1)==length(gbl_G2)'' as well!)
Note: Here
and below, when we say ``along the lines of'', the names of some
variables (especially internal working variables of a function) in the
example may not correspond exactly to those in your routine.