From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to use a vector as an index for a matrix
Date: Thu, 09 Aug 2012 09:45:05 -0500
Organization: NNTP Server
Lines: 23
Message-ID: <k00idl$ln6$>
References: <k00d1c$13u$> <k00i2i$ih3$>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20120306 Thunderbird/3.1.20
X-Notice: Filtered by postfilter v. 0.8.2
Xref: comp.soft-sys.matlab:776057

On 8/9/2012 9:39 AM, Matt J wrote:

> I may be missing something, but I don't see why people are recommending
> sub2ind here. This should do it:
> tcell=num2cell(t);
> M(tcell{:})

Actually, you're correct, Matt.  :)

Classic case of misdirection where the vector gets one thinking in the 
wrong direction...

I'm curious since my version doesn't have the multilevel indexing--does


work w/o the temporary (I'd hope)?