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:
sort data for big value and highest hits

Subject: sort data for big value and highest hits

From: smar

Date: 25 Jan, 2009 17:23:07

Message: 1 of 2


I have a histogram data set A

Col 1 = hits
Col 2 = value


A = [

  118.7300 0.0168
    6.9800 0.0503
    1.6400 0.1845
    1.7900 0.2181
    2.1800 0.2516
    7.7900 0.2852
   31.5700 0.3187
   2.1800 0.2516

]

The answer is value=0.3187 (second last row) which I want to extract form this data set A.
It is based on following constraint


The valve should be bigger that 0.1 and should have highest or second highest hits.

How can I extract this ?
thanks
smar

Subject: sort data for big value and highest hits

From: Joerg Buchholz

Date: 25 Jan, 2009 17:54:07

Message: 2 of 2

"smar " <smar234@yahoo.com> wrote in message <gli75r$isv$1@fred.mathworks.com>...
>
> I have a histogram data set A
>
> Col 1 = hits
> Col 2 = value
>
>
> A = [
>
> 118.7300 0.0168
> 6.9800 0.0503
> 1.6400 0.1845
> 1.7900 0.2181
> 2.1800 0.2516
> 7.7900 0.2852
> 31.5700 0.3187
> 2.1800 0.2516
>
> ]
>
> The answer is value=0.3187 (second last row) which I want to extract form this data set A.
> It is based on following constraint
>
>
> The valve should be bigger that 0.1 and should have highest or second highest hits.
>
> How can I extract this ?
> thanks
> smar

Try to understand the following line of code

find (A(:,1) == max (A(:,1)))

by using

help find
help max
help eq
help colon

Tags for 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