[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: no way for simple matrix lookup ?
From: |
Daniel J Sebald |
Subject: |
Re: no way for simple matrix lookup ? |
Date: |
Wed, 16 Jun 2004 13:16:53 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 |
D. Goel wrote:
Is the only way to do that a for loop? Is that inefficient?
Loops are inefficient, yes.
Any way to do that?
One way would be to turn A into a vector using "reshape" and then use a
formula of b and c. E.g.,
[m,n] = size(A);
reshape(A,1,m*n)(b+m*(c-1))
It's a kludge, I know.
Dan