From: Mohammed on 28 Apr 2010 12:15 Hi, I have 383 matrices of size 256x320. I was wondering how to concatenate them vertically into one big matrix?
From: Matt Fig on 28 Apr 2010 12:27 See the help for VERTCAT.
From: James Tursa on 28 Apr 2010 12:47 "Mohammed " <mohammed98221(a)gmail.com> wrote in message <hr9mup$j70$1(a)fred.mathworks.com>... > Hi, > > I have 383 matrices of size 256x320. I was wondering how to concatenate them vertically into one big matrix? Are they individually named? If so, does the name have a pattern? Or are they part of a cell array? James Tursa
From: Mohammed on 29 Apr 2010 05:40 "James Tursa" <aclassyguy_with_a_k_not_a_c(a)hotmail.com> wrote in message <hr9oq8$n1h$1(a)fred.mathworks.com>... > "Mohammed " <mohammed98221(a)gmail.com> wrote in message <hr9mup$j70$1(a)fred.mathworks.com>... > > Hi, > > > > I have 383 matrices of size 256x320. I was wondering how to concatenate them vertically into one big matrix? > > Are they individually named? If so, does the name have a pattern? Or are they part of a cell array? > > James Tursa The individual files are named x1.mat to x383.mat. I have looked at the vertcat help section and it seems the only way to do it is manually for example y = vertcat(x1,x2,..., x383), which seems like a cumbersome way.
From: Jos (10584) on 29 Apr 2010 07:14 "Mohammed " <mohammed98221(a)gmail.com> wrote in message <hrbk66$kfs$1(a)fred.mathworks.com>... > "James Tursa" <aclassyguy_with_a_k_not_a_c(a)hotmail.com> wrote in message <hr9oq8$n1h$1(a)fred.mathworks.com>... > > "Mohammed " <mohammed98221(a)gmail.com> wrote in message <hr9mup$j70$1(a)fred.mathworks.com>... > > > Hi, > > > > > > I have 383 matrices of size 256x320. I was wondering how to concatenate them vertically into one big matrix? > > > > Are they individually named? If so, does the name have a pattern? Or are they part of a cell array? > > > > James Tursa > > The individual files are named x1.mat to x383.mat. I have looked at the vertcat help section and it seems the only way to do it is manually for example y = vertcat(x1,x2,..., x383), which seems like a cumbersome way. Thinking about your data structure beforehand is recommended, so, if possible, try to create the matrices in another way using cell arrays or structs! Otherwise, here is a(nother cumbersome solution) % some data x1 = [1 2] ; x2 = [3 4] ; x3 = [4 5] % engine save temp x* S = load(temp) ; S = struct2cell(S) S = vertcat(S{:}) Alternatives could be envisioned using eval, but my shrink told me to avoid that function ;-) hth Jos
|
Next
|
Last
Pages: 1 2 3 Prev: OLS problem with non-linear constraint Next: s-function within s-function |