×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

combining timeseries

combining timeseries

combining timeseries

(OP)
I have two time series objects:

FLOW, with 8382 samples
Start time 8.890500e+002 minutes
End time 5.242600e+003 minutes

PRESSURE with 16256 samples
Start time 1.674965e+000 days
End time 3.556331e+000 days

The origo of both are the same (0 minutes in the first = 0 days in the second) I want to produce a matrix with three columns like this:

time1 FLOW-at-time1 PRESSURE-at-time1
time2 FLOW-at-time2 PRESSURE-at-time2
.....
.....

The start and ending time should be defined by the time period where FLOW and PRESSURE overlap, where they are both measured. (starting at 2411 minutes that is)
To do this seems to require a number of different operations in the tstool GUI or by direct commands, and I've been unable to accomplish it. Solutions or tips would be much appreciated.

RE: combining timeseries

(OP)
Ok, I figured this one out myself. The problem was due to a possible bug or lack of feature in the resample function for timeseries.

When time in a timeseries object is numeric, that is not a datestring, it seems that resample ignores the time unit information in the timeseries object and assume all to be the same. The below code adjust from "days" to "minutes" manually

time = PRESSURE.Time;
Resampled_FLOW = resample(FLOW,time*24*60);

This way, FLOW is resampled to include measurements only at the times when measurements of PRESSURE existed.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources