#!/usr/bin/perl use warnings; use Math::Matrix; #say you have equations # 1x 2y 3z 4w = 17 # 5x 6y 7z 8w = 18 # 9x 10y 11z 12w = 19 # 13x 14y 15z 16w = 20 $a = new Math::Matrix ([1,2,3,4], [5,6,7,8], [9,10,11,12], [13,14,15,16]); $x = new Math::Matrix ([17,18,19,20]); print "det-> ",$a->determinant,"\n"; $a->print("A\n"); $E = $a->concat($x->transpose); $E->print("Equation system\n"); $s = $E->solve; $s->print("Solutions s\n"); $a->multiply($s)->print("A*s\n");