Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Aligning uneven timeseries object

Subject: Aligning uneven timeseries object

From: david

Date: 20 Jan, 2011 12:01:04

Message: 1 of 1

Hi,

Apologies if this has been asked before, I'm relatively new to Matlab and I have been unable to find an answer through searching the website. If it has been asked & answered before, I'd really appreciate being pointed in the direction of the relevant post.

I have 2 data sets (A+B) whose values are time Vs returns. ie:
A=
Date data
01/01/2011 100
02/01/2011 200
03/01/2011 300
05/01/2011 200

They are both of differing length, they do however have the same start & end dates.
 So B may read:

B=
Date data
01/01/2011 50
03/01/2011 30
04/01/2011 80
05/01/2011 90

I would like to recreate A & B so that they would now read:

A=
Date data
01/01/2011 100
02/01/2011 200
03/01/2011 300
04/01/2011 300
05/01/2011 200

B=
Date data
01/01/2011 50
02/01/2011 50
03/01/2011 30
04/01/2011 80
05/01/2011 90

So, I would like to insert the date present in A but not B into B and visa versa, while poulating the new data field with the previous value.

Any help on this would be much appreciated.
David


      

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us