From: Luna Moon <>
Newsgroups: comp.soft-sys.matlab
Subject: How do you do this fast?
Date: Fri, 11 Jun 2010 13:26:13 -0700 (PDT)
Lines: 43
Message-ID: <>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: 1276287973 9035 (11 Jun 2010 20:26:13 GMT)
NNTP-Posting-Date: Fri, 11 Jun 2010 20:26:13 +0000 (UTC)
Injection-Info:; posting-host=; 
User-Agent: G2/1.0
X-HTTP-Via: 1.1 piinbcgw03
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: 
	Gecko/2010041205 Firefox/3.6.3ms1,gzip(gfe)
Xref: comp.soft-sys.matlab:644265

Hi all,

I have sets A, B, C, where C is the biggest set, A is the smallest,

C>B>A, i.e. C contains B contains A.

These are indices indeed.

I have a matrix m x n matrix MatrixC, where C=[1:n].

I have created a matrix MatrixB, which is

MatrixB=MatrixC(:, B).

Now I want to obtain MatrixA, which is

MatrixA=MatrixC(:, A).


However, in reality, actually for cost reasons, I didn't measure all

instead, I took measurements for MatrixB.

So all I have now is MatrixB, and sets A, B, C.

i.e. the indices A and B are "in C's language".

i.e. the indices A and B are numbered according to their positions in

So the question is:

how do I obtain MatrixA from MatrixB and sets A, B, C?

I currently use a "for" loop plus "find" etc. to do this job,

are there any fast approach without using "for" and "find"?

Mine is too slow... too stupid...

Thank you!