Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: find elements to include page indices
Date: Thu, 24 Jul 2008 07:45:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 17
Message-ID: <g69bu0$jfq$1@fred.mathworks.com>
References: <g677t2$j92$1@fred.mathworks.com> <g67c9g$lsl$1@fred.mathworks.com> <g67foc$92q$1@fred.mathworks.com> <g67hkb$5bl$1@fred.mathworks.com> <g67lt6$4c9$1@fred.mathworks.com> <g67oup$fhu$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1216885504 19962 172.30.248.38 (24 Jul 2008 07:45:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 24 Jul 2008 07:45:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1338633
Xref: news.mathworks.com comp.soft-sys.matlab:481431



> when you access it in the second way, you're getting the
> matrix b at the linear indices 1, 2, and 1. Your output will
> be something like [num1 num2 num1]. Instead, you should
> access it via the linear indices (the ones you found BEFORE
> passing to ind2sub). if you use those indices and the
> c=b([linearindices]) notation, it should work.


Ok, using linear indices c=b(linearindices) I get c to be a
matrix of the size [788 1]. b is [90 16 50] and so how can i
get c back into the form [90 16 50]? I have tried ind2sub on
c as follows:

d=ind2sub([90 16 50],real(c))

but the size of d is still [788 1]. any ideas? thanks for
your help so far.