From: Mohammed on
Hi,

I have 383 matrices of size 256x320. I was wondering how to concatenate them vertically into one big matrix?
From: Matt Fig on
See the help for VERTCAT.
From: James Tursa on
"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
"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
"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