[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

some multi-dimensional matrix problem

From: Bart Vandewoestyne
Subject: some multi-dimensional matrix problem
Date: Fri, 21 May 2004 04:02:30 -0500
User-agent: Mutt/1.3.28i

Suppose you had a multi-dimensional matrix p that looked like:

>> p

p(:,:,1) =

    0.8995    0.3137    0.2517    0.4330    0.8424

p(:,:,2) =

    0.1845    0.5082    0.4522    0.3256    0.3801

I'm sure from my calculations that p(:,:,x) is always a 1xN vector.
Now I want to combine all these 1xN vectors into a single result matrix,
and I'm currently doing it like this (M is the max last dimension of p):

for j=1:M,
  res(j,:) = p(:,:,j);

which gives me what i want, but I was wondering if there's a faster,
more vectorized way...


!!!!!!!!!!!!!!!!!!! email change !!!!!!!!!!!!!!!!!!!!
My email address is now address@hidden
        Please update your addressbook!

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]