Got Questions? Get Answers.
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:
how to find index based on other identifiers in a matrix

Subject: how to find index based on other identifiers in a matrix

From: Hatoddyam Toto

Date: 7 Mar, 2013 05:23:26

Message: 1 of 2

HI,
  I got the following problem:

   Suppose I have this matrix A = [ 1 0.1 5 2
                                                            9 0.2 10 4
                                                            5 0.3 15 6
                                                            10 0.4 20 8
                                                            2 0.5 25 10]


How can I get the row-index corresponding to three elements in col 2, 3 & 4? for example, corresponding row of three elements [0.4 20 8] is 4.

thanks,
Hato

Subject: how to find index based on other identifiers in a matrix

From: dpb

Date: 7 Mar, 2013 17:20:10

Message: 2 of 2

On 3/6/2013 11:23 PM, Hatoddyam Toto wrote:
...
> Suppose I have this matrix
> A = [ 1 0.1 5 2
> 9 0.2 10 4
> 5 0.3 15 6
> 10 0.4 20 8
> 2 0.5 25 10]
>
>
> How can I get the row-index corresponding to three elements in col
> 2, 3& 4? for example, corresponding row of three elements [0.4 20 8] is 4.
>

doc ismember
doc intersect

NB optional return values and the 'rows' optional input argument of
latter, 'rows' option of former...

--

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