The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Shifting data
Replies: 2   Last Post: Feb 18, 2010 9:49 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 6
From: Netherlands
Registered: 2/18/10
Re: Shifting data
Posted: Feb 18, 2010 9:49 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Dear Jan Simon,

Thanks for your reply. I'm sorry for my explanation. But I have the solution.

function [x] = FuncFindTrig(signal, trig)

% Find point closest to trigger point (trig)

% find point closest to trig
B1 = abs(signal-trig);
[C,D] = min(B1);

% when first point is bigger than trig, use second point
B2 = signal>trig;

% sig1 = x>trx;
sig2 = B2(2:end) - B2(1:end-1);
B3 = find (sig2==1);

if B3(1)==1;
B3(1)= B3(2)+1;
else B3(1)=B3(1)+1;

UPx = B3(1);
LPx = B3(1)-1;
UPy = signal(UPx);
LPy = signal(LPx);

% a = delY/delX;
a = (UPy-LPy)/(UPx-LPx);
b = signal(LPx);

% y = ax+b;
x = LPx+(trig-b)/a;

This is my solution:
% shifting figures to same point xA and xB must be zero
Bsize= size(B);

% B2=B(xBtrig:end)
t= 1-xBtrig:1:Bsize(2)-xBtrig;


It is of course only the display of the figure that needed to be changed, not the data as such.

Date Subject Author
Read Shifting data
Read Re: Shifting data
Jan Simon
Read Re: Shifting data

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.