Speed and Multiple Vectors
이전 댓글 표시
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?
채택된 답변
추가 답변 (1개)
Star Strider
2014년 2월 26일
0 개 추천
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.
카테고리
도움말 센터 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!