inverse of a matrix

by 3 replies
4
I need to get the inverse of a matrix for a gradient descent algorithm for my website. how can this be done in PHP?
#programming #inverse #matrix
  • Of course it can.. I can't really think of any "proper" language that it wouldn't be possible in.

    A matrix is nothing special.. just an array with numbers..

    Cheers,
    Michael
    • [1] reply
    • I know what a matrix is, and i know it can be done in PHP.. my question was HOW it can be done
  • Ohh - sorry mate - I somehow skipped over the 'how' and read it as 'can it be done?' My mistake!

    At the end of the day, the maths is fairly straight forward - you haven't specified the dimensions of your matrix, so there isn't really a simple answer to your question.

    This page does a pretty good job of explaining how to inverse a matrix:

    https://www.purplemath.com/modules/mtrxinvr.htm

    Otherwise, your best bet if you don't understand the maths would be to search around for a chunk of code that does what you want for an appropriately sized matrix. 3D coding forums would be a good starting point..

    Cheers,
    Michael

Next Topics on Trending Feed