title: Sorting (with conditions) using Matlab
body: <p>Using Matlab, I will like to sort the following wireless sensor readings in descending order, using the received signal strength (RSS) values in Column 2. I will like to find the average of the coordinates corresponding to the three highest RSS values. Column 3 is the coordinate of each of the sensor, while Column 4 are the wireless sensors that are visible to the sensor in Column 1.</p>
  
  <p>However, there is a condition that must be met. The three highest values to be selected must be visible to each other. For instance, if sensors A,D,F are selected, sensors D and F must be visible to A, sensors A and D must be visible to F, and sensors A and F must be visible D.</p>
  
  <pre><code>Column 1    Column 2    Column 3                Column 4 
                                          (Sensors that are visible to 
                                          the sensor in Column 1)
    A          -45          1,1                  B,C,D,E,H
    B          -90          1,5                  A,D,C,E,H
    C          -50          3,9                  A,B,E,H,G
    D          -54          4,2                  A,C,B,F,G
    E          -70          4,6                  C,D,H,G
    F          -57          7,2                  B,D,H,I
    G          -75          7,6                  D,B,I,E
    H          -64          6,9                  E,D,G,I
    I          -23          9,9                  H,G,F,B
  </code></pre>
  
  <p>Looking forward to any form of assistance. Grateful</p>