"Erik" <emiehling@gmail.com> wrote in message <h6nbt8$76v$1@fred.mathworks.com>...
> Hi,
>
> This problem could just as easily generalize to a vector of matrices. Here it is,
> I am having a bit of difficulty constructing a vector of vectors of varying lengths. That is,
>
> T1 is a mx1 vector
> T2 is a nx1 vector
> .
> .
> .
> TX is a zx1 vector
>
> where X,m,n,z are all positive integers. Ideally, if these were all the same length, I would just construct T = [T1 T2 ... TX] such that I could access Tj with T(:,j). But if these vectors are different lengths, how would I efficiently put them into one vector or cell such that I could index each vector easily? I realize I could zero pad each one appropriately, but there must be a better way.
>
> Thanks
T = {T1,T2,...,TX}
To get at one of the vectors, use the { } notation. e.g.,
T{1} would get you T1, etc.
James Tursa
