Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Complex matrix indexing...help!

Subject: Complex matrix indexing...help!

From: Mike

Date: 29 May, 2012 22:38:09

Message: 1 of 4

Hey all,

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 ( http://i.imgur.com/CnYeh.png ). I want to form two separate matrices that consist of values along those two black diagonal lines. Any suggestions?

Subject: Complex matrix indexing...help!

From: Roger Stafford

Date: 29 May, 2012 23:34:13

Message: 2 of 4

"Mike " <mpinter09@gmail.com> wrote in message <jq3j4h$hf9$1@newscl01ah.mathworks.com>...
> Hey all,
>
> 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 ( http://i.imgur.com/CnYeh.png ). I want to form two separate matrices that consist of values along those two black diagonal lines. Any suggestions?
- - - - - - - - - - -
  Let t be a logical matrix that is true on the black part and false everywhere else in the image. Then do:

 [x,y] = find(t);

Roger Stafford

Subject: Complex matrix indexing...help!

From: Mike

Date: 30 May, 2012 00:38:07

Message: 3 of 4

"Roger Stafford" wrote in message <jq3mdl$scg$1@newscl01ah.mathworks.com>...
> "Mike " <mpinter09@gmail.com> wrote in message <jq3j4h$hf9$1@newscl01ah.mathworks.com>...
> > Hey all,
> >
> > 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 ( http://i.imgur.com/CnYeh.png ). I want to form two separate matrices that consist of values along those two black diagonal lines. Any suggestions?
> - - - - - - - - - - -
> Let t be a logical matrix that is true on the black part and false everywhere else in the image. Then do:
>
> [x,y] = find(t);
>
> Roger Stafford
-----------------------
Thanks Roger.
I'm still in the dark on the best way to define the black line though. Any advice?

Subject: Complex matrix indexing...help!

From: Roger Stafford

Date: 30 May, 2012 00:54:07

Message: 4 of 4

"Mike " <mpinter09@gmail.com> wrote in message <jq3q5f$b16$1@newscl01ah.mathworks.com>...
> I'm still in the dark on the best way to define the black line though. Any advice?
- - - - - - - - -
  Judging by the image I see at your link, the v-shape 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.

  On the other hand if you want the v-shape 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.

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us