Vector concatenation without using a for loop (MATLAB)

  • Context: MATLAB 
  • Thread starter Thread starter wkleonard
  • Start date Start date
  • Tags Tags
    Loop Matlab Vector
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
wkleonard
Messages
1
Reaction score
0
I have a variable number of vectors to concatenate in my Matlab model. Is there a way to do this without a for loop? The number will depend upon input parameters. Suggestions.
 
Physics news on Phys.org
If they are stored in a matrix (as then tend to be when read from a file with e.g. dlmread), you can reshape the matrix into a vector with the cleverly named command 'reshape'.