In Matlab, you can solve this by using the built-in function sqrtm()
to get the square root of a matrix. Here's an example code to solve x^2 = [2 3; 4 5]
:
main.m73 chars6 lines
Note that the solution is not unique, since a matrix can have multiple square roots.
gistlibby LogSnag