Vector concatenation without using a for loop (MATLAB)

  • #1
1
0

Main Question or Discussion Point

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.
 

Answers and Replies

  • #2
191
8
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'.
 

Related Threads on Vector concatenation without using a for loop (MATLAB)

Replies
2
Views
28K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
2
Views
8K
  • Last Post
Replies
3
Views
3K
  • Last Post
Replies
3
Views
3K
Replies
1
Views
17K
  • Last Post
Replies
10
Views
3K
Replies
1
Views
3K
Top