On Oct 17, 2011, at 9:15 AM, preeti gaikwad wrote:
> Hello all,
>
> If I have x and f(x) I want to find out the maxima of f(x) and position of the same so for that if I write the syntax like "max(f(x))" I will get it but how to get its position means the corresponding x value????
>
> Now suppose I have 'n' value of x and f(x), and there I have three peaks in the f(x) where one peak is the "reference peak" where I want to find (its position and amplitude, width) and fit with the Gaussian function, second peak coming from the actual sample. and the third is the unwanted peak in the sample (called the noise).
>
> using octave I want to get rid of this noise peak where I know want to know the width and the position to remove this
>
> 1. If I say max(f(x)) then I get only one peak at but how to write syntax for getting position??? I already knew the width of this pulse but how to find the width of the noise pulse????
> 2. how to find second peak its position and width?
> thanks a lot in advance for solving my problem........
You just need the second output of the max() function.