Solving Systems of Linear Equations with ljx.m

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 2K views
mathmari
Gold Member
MHB
Messages
4,984
Reaction score
7
Hey! I need some help using the Matlab function ljx.m for solving a system of linear equations. I found a solved example for A= [tex]\bigl(\begin{smallmatrix}<br /> 1 & -1 &0 & 1\\ <br /> 1 & 0& 1 & 0\\ <br /> 1 &1 &2 & -1<br /> \end{smallmatrix}\bigr)[/tex] and b=[tex]\bigl(\begin{smallmatrix}<br /> 1\\ <br /> 1\\ <br /> -1<br /> \end{smallmatrix}\bigr)[/tex].
At the first time they call the function by ljx(T,2,1).
Why do they take as pivot this element, and not for example ljx(T,1,1)??
Is there a specific reason, or can we take as pivot any element we want as long as it's different from 0?
:confused:
 
Last edited by a moderator:
Physics news on Phys.org
When I call the function ljx(T,1,1), then ljx(2,2) I get that the row [tex]y_{3}[/tex] is dependent and can be written as [tex]y_{3}=-y_{1}+2y_{2}+1[/tex].

When I call the function ljx(T,2,1), then ljx(T,3,2) I get [tex]y_{1}=2y_{2}-y_{3}+1[/tex].
If I solve for [tex]y_{3}[/tex] I get the same answer as at the first case. But the result [tex]y_{1}=2y_{2}-y_{3}+1[/tex] doesn't mean that [tex]y_{1}[/tex] is dependent and [tex]y_{3}[/tex] independent?
Are the results at both cases equal??