I'm trying to write a function that takes in a skew symmetric matrix and returns the corresponding vector. When I write the following code, it works when I leave it as variables, but it does not work when I plug in numbers. Any help would be appreciated.
skewToq[{{0, -q3_, q2_}, {q3_, 0, -q1_}, {-q2_, q1_, 0}}] := {q1, q2, q3};
skewToq[{{0, -q3, q2}, {q3, 0, -q1}, {-q2, q1, 0}}]
{q1, q2, q3}
Now, when I plug in an actual skew-symmetric matrix, the function does not work...
skewToq[{{0, -3, 2}, {3, 0, -1}, {-2, 1, 0}}]
skewToq[{{0, -3, 2}, {3, 0, -1}, {-2, 1, 0}}]
Thanks!