Speed and Multiple Vectors
Ältere Kommentare anzeigen
Is it faster to operate on multiple individual vectors or to put many vectors into a single matrix and simply reference the columns of the resulting matrix?
Akzeptierte Antwort
Weitere Antworten (1)
Star Strider
am 26 Feb. 2014
0 Stimmen
I suggest combining them into a single matrix and referencing the columns of the resulting matrix. It’s a lot easier to code and store those results. This works for vectors of equal lengths.
If you encounter the problem of the vectors having different lengths, it°s easy to use a cell array to store them and have them behave essentially as a matrix (except for not being able to use that matrix in matrix computations). It is easy to convert them back to numerical vectors for computation when you need to.
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!