I solved it, if you change the matrixes to A=[3 0 -2;4 2 -3;-1 4 0;0 1 0] and B=[0 0 0 1] then it's not overdetermined and can actually be solved.
Help solving systems of linear equations
4 views (last 30 days)
Show older comments
I am trying to write a code to properly charge balance chemical reactions (complex redox reactions), and have run into some math issues. I am starting with a simple equation that I know the solution for:
I am trying to solve the equation Ax=B for the matrix A=[3 0 -2;4 2 -3;-1 4 0] when B=[0;0;0], the solution I am looking for is x=[4;1;6]. However, when I try to solve for x using x=A\B I get the following warning "Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 9.462128e-19." and the solution I get is x=[0;0;0].
How do I get a nonzero solution for my A matrix?
Thanks
Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!