[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reading mat file
From: |
ahowe42 |
Subject: |
Re: Reading mat file |
Date: |
Wed, 21 Mar 2012 06:23:54 -0700 (PDT) |
I'm a bit confused about who's actually asking this question, as the poster
names keep changing???
Regardless, here's a solution that *won't work for every dataset*, but I
think will work in your case.
% first derivative (kind of)
dx = diff(vvl);
% second derivative (kind of)
dxx = diff([0,dx]);
% peaks (peaks = -2, troughs = 2)
idx = find(dxx == -2);
% now get the peak vvl values & corresponding x values
vvl(idx)
x(idx)
I tested this with a very simple dataset and it worked, but can't guarantee
it will always work. In particular, if the peak is something like this:
[1,2,3,3,3,2,1], this code will not identify it. Looking at the plot you
sent me, it should be ok.
Andrew
--
View this message in context:
http://octave.1599824.n4.nabble.com/Re-Reading-mat-file-tp4487833p4492254.html
Sent from the Octave - General mailing list archive at Nabble.com.
- Re: Reading mat file, (continued)
- Re: Reading mat file, asha g, 2012/03/20
- Re: Reading mat file, asha g, 2012/03/21
- Re: Reading mat file, asha g, 2012/03/21
- Re: Reading mat file, ahowe42, 2012/03/21
- Re: Reading mat file, asha g, 2012/03/21
- Re: Reading mat file, ahowe42, 2012/03/21
- Re: Reading mat file, asha g, 2012/03/21
- Re: Reading mat file, asha g, 2012/03/21
- Message not available
- Re: Reading mat file, asha g, 2012/03/21
- Re: Reading mat file, Doug Stewart, 2012/03/21
- Re: Reading mat file,
ahowe42 <=
- Re: Reading mat file, Jordi GutiƩrrez Hermoso, 2012/03/21
- findpeak, asha g, 2012/03/28
- findpeak, asha g, 2012/03/28
- Re: findpeak, Luke M, 2012/03/28
- Re: findpeak, asha g, 2012/03/29
- Re: findpeak, Luke M, 2012/03/29
- 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