http://www.mathworks.com/matlabcentral/newsreader/view_thread/320545
MATLAB Central Newsreader  Complex matrix indexing...help!
Feed for thread: Complex matrix indexing...help!
enus
©19942015 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Tue, 29 May 2012 22:38:09 +0000
Complex matrix indexing...help!
http://www.mathworks.com/matlabcentral/newsreader/view_thread/320545#878333
Mike
Hey all,<br>
<br>
I'm not sure how to approach this problem. I have a large matrix that I need to index particular values of, specifically along a diagonal line alone the matrix. Here is a contour plot of the data for clarity ( <a href="http://i.imgur.com/CnYeh.png">http://i.imgur.com/CnYeh.png</a> ). I want to form two separate matrices that consist of values along those two black diagonal lines. Any suggestions?

Tue, 29 May 2012 23:34:13 +0000
Re: Complex matrix indexing...help!
http://www.mathworks.com/matlabcentral/newsreader/view_thread/320545#878338
Roger Stafford
"Mike " <mpinter09@gmail.com> wrote in message <jq3j4h$hf9$1@newscl01ah.mathworks.com>...<br>
> Hey all,<br>
> <br>
> I'm not sure how to approach this problem. I have a large matrix that I need to index particular values of, specifically along a diagonal line alone the matrix. Here is a contour plot of the data for clarity ( <a href="http://i.imgur.com/CnYeh.png">http://i.imgur.com/CnYeh.png</a> ). I want to form two separate matrices that consist of values along those two black diagonal lines. Any suggestions?<br>
          <br>
Let t be a logical matrix that is true on the black part and false everywhere else in the image. Then do:<br>
<br>
[x,y] = find(t);<br>
<br>
Roger Stafford

Wed, 30 May 2012 00:38:07 +0000
Re: Complex matrix indexing...help!
http://www.mathworks.com/matlabcentral/newsreader/view_thread/320545#878348
Mike
"Roger Stafford" wrote in message <jq3mdl$scg$1@newscl01ah.mathworks.com>...<br>
> "Mike " <mpinter09@gmail.com> wrote in message <jq3j4h$hf9$1@newscl01ah.mathworks.com>...<br>
> > Hey all,<br>
> > <br>
> > I'm not sure how to approach this problem. I have a large matrix that I need to index particular values of, specifically along a diagonal line alone the matrix. Here is a contour plot of the data for clarity ( <a href="http://i.imgur.com/CnYeh.png">http://i.imgur.com/CnYeh.png</a> ). I want to form two separate matrices that consist of values along those two black diagonal lines. Any suggestions?<br>
>           <br>
> Let t be a logical matrix that is true on the black part and false everywhere else in the image. Then do:<br>
> <br>
> [x,y] = find(t);<br>
> <br>
> Roger Stafford<br>
<br>
Thanks Roger.<br>
I'm still in the dark on the best way to define the black line though. Any advice?

Wed, 30 May 2012 00:54:07 +0000
Re: Complex matrix indexing...help!
http://www.mathworks.com/matlabcentral/newsreader/view_thread/320545#878349
Roger Stafford
"Mike " <mpinter09@gmail.com> wrote in message <jq3q5f$b16$1@newscl01ah.mathworks.com>...<br>
> I'm still in the dark on the best way to define the black line though. Any advice?<br>
        <br>
Judging by the image I see at your link, the vshape is a solid black color and all other locations have colors that are far from black. It ought to be an easy task to subject the three color intensities to some logical test that would distinguish the black part from all other areas so as to generate the required 't' matrix.<br>
<br>
On the other hand if you want the vshape to be determined by purely geometrical means, you have the somewhat more difficult task of testing whether pixels lie within the geometrical shape, which would involve knowing the lines' width and the shape of their ends. Hopefully that is not what you are faced with.<br>
<br>
Roger Stafford