Gleb Makarchuk
Gleb Makarchuk

Reputation: 65

Concatenating cell array of one size matrices into one multidimentional matrix in matlab

Assuming I have a cell array of matrices of one size: {m1,m2,m3,m4...}. Is it possible to concatenate them along the 3rd dimension without using cycles?

Upvotes: 1

Views: 38

Answers (1)

Daniel
Daniel

Reputation: 36720

Use cat(3,m{:}). The m{:} creates a comma separated list which unpacks your cell to individual arguments.

Upvotes: 2

Related Questions