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

New to MATLAB?

How can i choose one result of numerical result?

Asked by Light

Light (view profile)

on 7 Jun 2013

I have to choose higher row number (only one result)

A=[-1,1,1;0,-1,0;0,0,-1;1,0,0];
blnA = logical( A == -1 );
blnOut = find(all(ismember(A,[0,-1]),2));
blnOut =
     2
     3

2 Comments

Azzi Abdelmalek

Azzi Abdelmalek (view profile)

on 7 Jun 2013

What is the expected result?

Light

Light (view profile)

on 7 Jun 2013

Expected result is 3. But if it is hard, just choose one result of them is enough.

Light

Light (view profile)

Tags

Products

No products are associated with this question.

2 Answers

Answer by Azzi Abdelmalek

Azzi Abdelmalek (view profile)

on 7 Jun 2013
Accepted answer
max(blnOut)

0 Comments

Azzi Abdelmalek

Azzi Abdelmalek (view profile)

Answer by Iain

Iain (view profile)

on 7 Jun 2013
 bInOut(end)

Swap end for something else if you want a different result, like 1 for the minimum, or 2 for the 2nd, etc.

1 Comment

Light

Light (view profile)

on 7 Jun 2013

Thank you very much!! :D

Iain

Iain (view profile)

Contact us