function grad=getgrad(W)
Input:
Output:
Using the expression in Eq. (10) and your H() operator
above, produce a function of the above prototype in the file
``getgrad.m''.
Hint: Matrix multiplication is associative, so that the final
result of a matrix product
does not depend on the order in which
the product is formed,
or
. However, the dimensions of
the intermediate values can be quite different. For instance
is the product of a
matrix with a
matrix, while
is the product of a
matrix with an
matrix. The former
will likely overflow the memory, whereas the latter will fit nicely.
Thus, in evaluating Eq. (10) in octave, you may wish to
include some ``extra'' parentheses.