From: Mohammad A. Mezher on
Hi,

how can i add different size of vectors in the same matrix???
e.g.
x = ones(1,5);
y= ones(1,6);
z= ones(1,4);

the required matrix:
mat=[x; y; z];


I appreciate any help
From: Nathan on
On Apr 27, 2:00 pm, "Mohammad A. Mezher" <mohabedalg...(a)yahoo.com>
wrote:
> Hi,
>
> how can i add different size of vectors in the same matrix???
> e.g.
> x = ones(1,5);
> y= ones(1,6);
> z= ones(1,4);
>
> the required matrix:
> mat=[x; y; z];
>
> I appreciate any help

Use a cell array.

mat = {x;y;z}
%%%%%%%%%%%%
mat =
[1x5 double]
[1x6 double]
[1x4 double]

mat{1}
%%%%%%%%%%%%
ans =
1 1 1 1 1


-Nathan