If I have a matrix (or a set of vectors) say A=[1 2 4] [2 9 8] [7 9 3] how can I calculate its span in MATLAB? There is no direct command for it? Do I have to form a set of linear equations, but I am confused;how will I be able to find all the possible linear combinations from it? Any help is appreciated.

  • 1
    $\begingroup$ have you tried rref? $\endgroup$ – user251257 Aug 22 '15 at 16:02
  • 1
    $\begingroup$ Use rank(A) command. $\endgroup$ – kaka Aug 22 '15 at 16:07
  • $\begingroup$ Does not the "rref" command returns the reduced echelon form for calculation of the rank? How is this supposed to give the entire span (all possible linear combinations) of A, or am I mixing things up? $\endgroup$ – Candy Aug 22 '15 at 16:13
  • 1
    $\begingroup$ RREF will show you which vectors are linearly independent. The span of A will be the span of those vectors. You should enter the vectors as columns of the matrix. $\endgroup$ – user217285 Aug 22 '15 at 16:36
  • 1
    $\begingroup$ How do you expect to be given "the entire span (all possible linear combinations)"? There are infinitely many of those (uncountably many, in fact). One needs some sort of mathematical notation (free variables) to describe this. Which means you are doing symbolic computations, which isn't really a strength of MATLAB; there is a Symbolic Toolbox for it but it isn't built-in. $\endgroup$ – user147263 Aug 22 '15 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.