To take the derivative of x'px, where x is a vector and p is a matrix, in Matlab, you can use the symbolic math toolbox. Here's an example of how it can be done:
main.m406 chars10 lines
The output of the above code will give you the derivative of x'px with respect to x, which is a vector.
gistlibby LogSnag