Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Vector concatenation without using a for loop (MATLAB)

  1. Jan 22, 2014 #1
    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.
  2. jcsd
  3. Jan 22, 2014 #2
    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'.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook