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:
find higher values

Subject: find higher values

From: rodrikas

Date: 21 Apr, 2010 15:29:29

Message: 1 of 2

hi,

I have a matrix and I would like to find the position (indexes) higher values (for example the 50 higher values). Is it possible to do it directly? (for example with the
"find" command ?).

Thanks in advance!

Rodrigo

Subject: find higher values

From: Sean

Date: 21 Apr, 2010 15:48:04

Message: 2 of 2

rodrikas <carballo.rodrigo@gmail.com> wrote in message <2084686195.49320.1271863799317.JavaMail.root@gallium.mathforum.org>...
> hi,
>
> I have a matrix and I would like to find the position (indexes) higher values (for example the 50 higher values). Is it possible to do it directly? (for example with the
> "find" command ?).
>

a = magic(10);
[b idx] = sort(a(:),'descend');
[row col] = ind2sub(size(a),idx(1:50));

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