Question: how to creat a `Arraylist` `adapter` which will change the `view` based on a `flag` in the `LISTVIEW`, Flag can be `IMAGE` , `IMAGETEXT`, `VIDEO` , `VIDEOTEXT`, `TEXT`

e.g like in facebook post , 1. if a friend posts a text, `list row` will only contain a text with his Name
2. if a friend posts a `Image` , list row will only contain a image with his Name
3. if a friend poasts a `Video` , list row will only contain a Video with his Name , and only Video `onClick()` ,
 Playing that Video in a external Player

1. Flag = text. view to be attached is `text.xml`
2. Flag = Video, View to be attached is `video.xml`
3. Flag = Image ,View to be attached is `image.xml`

ANY HELP ON THIS. 

Thanks in Advance...

Answer: 
Let's say finding the first 5 peaks with minimum height of 0.5 and with a distance of 10 points from each other,

```
[pks, locs] = findpeaks(FFT, 'NPEAKS', 3, 'MINPEAKHEIGHT', 0.5, 'MINPEAKDISTANCE', 10);

```

Then `pks` is your `y` and `locs` is your `x` coordenate from your peaks.

Hope it helps
your pseudo code can be reduced to:

```
FFT(1:50:250)

```

but I think `findpeaks` will be more robust