1

I'm creating a function which given two basis for a vector space, it returns the change of basis matrix from one basis to the other. The problem is that I don't know how to represent a basis. A basis is basically a set (where duplicates are not possible) of vectors.

How can I represent a basis in Matlab? Which data structure should I use? You can give more than one possibility, but of course efficient matters, even though it's a secondary problem for now.

Should I simply use a normal matrix, where for example the columns would represent the vectors of the basis? Is there a better solution?

nbro
  • 15,395
  • 32
  • 113
  • 196
  • 1
    A matrix is usually how a vector basis is represented no? What's wrong with just a matrix? I recommend a matrix because the linear algebraic properties once you create the basis in a matrix can be made using many of the built-in functions that MATLAB has to offer. – rayryeng Feb 27 '16 at 17:27
  • Incidentally, if the columns of `V1` are the old basis, the columns of `V2` are the new basis, and `V2=A*V1`, then `A=V2/V1`. Use matrices. – Andras Deak -- Слава Україні Feb 27 '16 at 17:40

1 Answers1

1

A matrix is the best choice, it is easy to use and very efficient. This is also what the built-in function orth chose to return a basis.

Daniel
  • 36,610
  • 3
  • 36
  • 69