Hello---
I have a vector 'v' which contains values sampled at discrete times
given in another vector 't'. After using the command 'plot(v,t)' in
Matlab, I would like to identify sections of the curve which appear to
be "nearly" horizontal on the plot.
Is there a robust way of doing this numerically using Matlab?
Nicholas
|
|
0
|
|
|
|
Reply
|
n.kinar (156)
|
5/26/2010 5:52:01 AM |
|
Nicholas Kinar <n.kinar@usask.ca> wrote in message <4BFCB701.1020209@usask.ca>...
> Hello---
>
> I have a vector 'v' which contains values sampled at discrete times
> given in another vector 't'. After using the command 'plot(v,t)' in
> Matlab, I would like to identify sections of the curve which appear to
> be "nearly" horizontal on the plot.
>
> Is there a robust way of doing this numerically using Matlab?
>
> Nicholas
a hint:
help sin; % <- and other siblings of this series of functions...
us
|
|
0
|
|
|
|
Reply
|
us
|
5/26/2010 6:24:35 AM
|
|
>
> a hint:
>
> help sin; % <- and other siblings of this series of functions...
>
> us
Hello us---
Thank you very much for your response! I've looked at the help file for
the sin() function. Do you mean that I need to apply sin() to my data
and then perhaps look for turning points in the curve?
Nicholas
|
|
0
|
|
|
|
Reply
|
Nicholas
|
5/26/2010 2:51:42 PM
|
|
Nicholas Kinar <n.kinar@usask.ca> wrote in message <4BFCB701.1020209@usask.ca>...
> Hello---
>
> I have a vector 'v' which contains values sampled at discrete times
> given in another vector 't'. After using the command 'plot(v,t)' in
> Matlab, I would like to identify sections of the curve which appear to
> be "nearly" horizontal on the plot.
>
> Is there a robust way of doing this numerically using Matlab?
>
> Nicholas
Try this:
% sample data
% t = 0:255;
% v = cumsum(randn(size(t)));
thresh=1;
n=find(abs(diff(v)./diff(t)) > thresh); % find points with high slope dv/dt
tt = reshape([t(n); t(n+1); nan(size(n))],[],1);
vv = reshape([v(n); v(n+1); nan(size(n))],[],1);
plot(v,t,'b-',vv,tt,'r')
The robustness of this will depend on exactly what "horizontal" means to you, and exactly what constitutes a "section of the curve".
|
|
0
|
|
|
|
Reply
|
Alan
|
5/26/2010 4:48:05 PM
|
|
> Nicholas Kinar <n.kinar@usask.ca> wrote in message
> <4BFCB701.1020209@usask.ca>...
>> Hello---
>>
>> I have a vector 'v' which contains values sampled at discrete times
>> given in another vector 't'. After using the command 'plot(v,t)' in
>> Matlab, I would like to identify sections of the curve which appear to
>> be "nearly" horizontal on the plot.
>>
>> Is there a robust way of doing this numerically using Matlab?
>>
>> Nicholas
>
> Try this:
>
> % sample data
> % t = 0:255;
> % v = cumsum(randn(size(t)));
>
> thresh=1;
> n=find(abs(diff(v)./diff(t)) > thresh); % find points with high slope dv/dt
> tt = reshape([t(n); t(n+1); nan(size(n))],[],1);
> vv = reshape([v(n); v(n+1); nan(size(n))],[],1);
>
> plot(v,t,'b-',vv,tt,'r')
>
> The robustness of this will depend on exactly what "horizontal" means to
> you, and exactly what constitutes a "section of the curve".
Agreed; thank you very much, Allen.
Nicholas
|
|
0
|
|
|
|
Reply
|
Nicholas
|
5/26/2010 5:15:59 PM
|
|
|
4 Replies
216 Views
(page loaded in 0.084 seconds)
Similiar Articles: Modelling chains - comp.cad.solidworksI can bodge it by having the 2 straight sections as ... to do so. > > Regards, > John H > > Would a curve ... and the equation will correctly evaluate for the horizontal ... Model a function fitting the data - comp.soft-sys.matlab ...This section from the documentation for MATLAB may also ... You can then use regression analysis to identify a set ... The example that I use in the blog shows a curve ... Dimensioning holes located on curved surfaces - comp.cad ...Maybe a section view thru the hole that would allow you ... are you looking for a way to measure along the curve? ... Dimensioning a 3d sketch with horizontal and vertical ... IBM mainframe printer typeface - equivalent font? - comp.fonts ...But I am having a devil of a time identifying the original ... 1403 printer trains had 240 characters in 5 sections of ... variable content (line printers can do only horizontal ... 3D sketch and structural - comp.cad.solidworksFYI 2007 has a full set of sections for weldments, same ... comp.cad.solidworks Dimensioning a 3d sketch with horizontal ... Hi, I am trying to plot the yield curve in 3D. So the ... Add text to plot without overlaying text - comp.soft-sys.matlab ...Depending, one could change vertical or horizontal ... to plots - comp.soft-sys.matlab adding label to curve ... plot a graphic and identify each point with a label ... [comp.publish.cdrom] CD-Recordable FAQ, Part 1/4 - comp.publish ...Archive-name: cdrom/cd-recordable/part1 Posting-Frequency: monthly Last-modified: 2008/10/09 Version: 2.71 Send corrections and updates to And... Sampling: What Nyquist Didn't Say, and What to Do About It - comp ...>> Specifically, this section on p.11: > >> Sampling ... Looks like a scan to me, page 2 text is not horizontal ... IIRC) markers in "picture 1" and "picture 2" identifying ... how to calculate area of a grayscale image? - comp.soft-sys.matlab ...- use BWLABEL to identify your objects... - use REGIONPROPS ... you quote a message in a reply, please delete the section ... Help fixing Gosper curve (image not as it should be ... top 10 uses for random data compression?? anyone? - comp ...Tell Ikram it's secondary declining in a curve. ... She'd rather identify enormously than complete with Agha ... Occasionally, it qualifys a writing too horizontal ... How to Identify the Conic Section | eHow.comHow to Identify the Conic Section. Conic sections are mathematical ... In this equation, x and y are the horizontal and ... is positive and the other is negative, the curve ... HORIZONTAL ALIGNMENTS AND CROSS SECTIONSHORIZONTAL ALIGNMENTS AND CROSS SECTIONS April ... Horizontal Curve ... an identifying prefix to the stationing, choose the sixth icon (stationing) on the Horizontal Curve Set ... 7/24/2012 1:46:21 AM
|