[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reading mat file
From: |
Luke M |
Subject: |
Re: Reading mat file |
Date: |
Sat, 31 Mar 2012 17:41:36 -0700 (PDT) |
asha g wrote
>
>
>
>> Oops, I missed this. If all you want are the indices of vector that
>> equal
>> the maximum value, that's a whole lot easier than finding local maxima.
>>
>> idx = find(vv1 == max(vv1))
>>
> But it will only give one max value instead of all the peak values - I
> need all peak values and their corresponding x values.
>
No, [m,i] = max(vv1) will give you the first index of the maximum value.
find(vv1 == max(vv1)) will give you all indices with numbers equal to the
maximum value.
octave:2> a = [1 2 3 3 2 3 2 1]
a =
1 2 3 3 2 3 2 1
octave:3> [m,i] = max(a)
m = 3
i = 3
octave:4> find(a==max(a))
ans =
3 4 6
--
View this message in context:
http://octave.1599824.n4.nabble.com/Re-Reading-mat-file-tp4487833p4522516.html
Sent from the Octave - General mailing list archive at Nabble.com.
- Re: findpeak, (continued)
- Re: findpeak -> peakdet.m ?, Olivier Crouzet, 2012/03/29
- Message not available
- Re: findpeak -> peakdet.m ?, Olivier Crouzet, 2012/03/30
- Re: findpeak -> peakdet.m ?, asha g, 2012/03/31
- Message not available
- Re: findpeak -> peakdet.m ?, asha g, 2012/03/29
- Re: Reading mat file, asha g, 2012/03/21
- Re: Reading mat file, Mech.Mon, 2012/03/22
- Re: Reading mat file, Luke M, 2012/03/29
- Re: Reading mat file, asha g, 2012/03/30
- Re: Reading mat file,
Luke M <=
- Re: Reading mat file, Doug Stewart, 2012/03/21