在 MAXIMA 中比较两个矩阵时如何使用 "solve"?

How to use "solve" while comparing two matrices in MAXIMA?

我想做一件简单的事情:

M: matrix([a,b], [c,d]);
N: matrix([1,2], [3,4]);
solve(M = N, [a,b,c,d]);

但我得到了结果 []。如果我把上面的分解成很多约束,像这样:

M: matrix([a,b], [c,d]);
N: matrix([1,2],[3,4]);
c1: M[1,1] = N[1,1];
c2: M[1,2] = N[1,2];
c3: M[2,1] = N[2,1];
c4: M[2,2] = N[2,2];
solve([c1, c2, c3, c4], [M[1,1], M[1,2], M[2,1], M[2,2]]);

我取得了不错的成绩[[a=1,b=2,c=3,d=4]]。但是这种方法对于大矩阵来说会很痛苦。有没有更简单的方法来做到这一点?

将矩阵转换为列表会有帮助

(%i1) M: matrix([a,b], [c,d])$
(%i2) N: matrix([1,2] [c,d])$
(%i3) f(M):= apply(join, args(M))$
(%i4) e: map("=",  f(M), f(N));
(%o4)                    [a = 1, c = 3, b = 2, d = 4]
(%i5) solve(e, [a, b, c, d]);
(%o4)                    [a = 1, c = 3, b = 2, d = 4]