help-octave
[Top][All Lists]

## Re: confused about how to define a cell array of vectors

 From: James Sherman Jr. Subject: Re: confused about how to define a cell array of vectors Date: Thu, 15 Nov 2007 12:22:12 -0500

```I'm a bit confused, and maybe others are too.  Why can't you simply
write a for loop like:

CA = cell(size(X));
for m = 1:size(X,1),
for n = 1:size(X,2),
CA{m,n} = [X(m,n), Y(m,n), Z(m,n)];
end
end

Is there something I'm missing?

On Nov 15, 2007 3:40 AM, DushanM <address@hidden> wrote:
> I've still not puzzled this out, and my earlier question about it didn't
> get a response, so I'm trying again.  Maybe rephrasing will help.
>
> I have a 2-D, curved grid of points, indexed by (m,n).  The (x,y,z) com-
> ponents of each point can be computed, giving three 2-arrays X, Y, and Z
> so that X(m,n) is the x-component of the (m,n) point, etc.  What I would
> now like to do, but don't know how, is define a 2-D cell array CA with
> each cell a 3-vector: CA{m,n} = [ X(m,n); Y(m,n); Z(m,n) ].
>
> Could someone please point me to how to do this, or to where I can find
> out?  Thanks.
>
> - Dushan Mitrovich
> _______________________________________________
> Help-octave mailing list