Data fitting / NonLinear Optimization/ least square algorithm

Hey everyone,
my problem is as follows I want to solve the equation e = H*x with:
e: 6x1 Vector with a measured Cartesian position
x: nx1 Error Vector that i want to solve for.
H: 6x n Matrix that is calculated based on values for x from the previous iteration step. (so H = f(x) in a way)

What is the best way to solve this?? I have looked into Linear Regression, my problem is though, that I will have 6 equations that calculate my 6 values of e while in linear regression only one equation is used every timeā€¦
Do I have to implement my own algorithm here or is there something I am not seeing? There is no/minimal explanation on how to use the Optimization class, so I am unsure if there is a way to this?
Thanks a lot for your help!