Thread Subject: save timeseries to file

Subject: save timeseries to file

From: Bastian

Date: 9 Feb, 2010 18:40:21

Message: 1 of 6

I would like to save timeseries objects to a file and then subsequently load them back into the workspace as timeseries. I am trying to do this to avoid having to recreate the timeseries each time I want to use them. Can this be done?

Subject: save timeseries to file

From: Oleg Komarov

Date: 9 Feb, 2010 18:59:05

Message: 2 of 6

"Bastian " <bastianschmidt@trentu.removethistext.ca> wrote in message <hksa6l$gbf$1@fred.mathworks.com>...
> I would like to save timeseries objects to a file and then subsequently load them back into the workspace as timeseries. I am trying to do this to avoid having to recreate the timeseries each time I want to use them. Can this be done?

help save

Oleg

Subject: save timeseries to file

From: Bastian

Date: 9 Feb, 2010 19:53:03

Message: 3 of 6

"Oleg Komarov" <oleg.komarovRemove.this@hotmail.it> wrote in message <hksb9p$pui$1@fred.mathworks.com>...
> "Bastian " <bastianschmidt@trentu.removethistext.ca> wrote in message <hksa6l$gbf$1@fred.mathworks.com>...
> > I would like to save timeseries objects to a file and then subsequently load them back into the workspace as timeseries. I am trying to do this to avoid having to recreate the timeseries each time I want to use them. Can this be done?
>
> help save
>
> Oleg

I wish it was that simlpe. I am talking about a MATLAB timeseries object not just any old variable in the workspace (check it out: help timeseries). Any other ideas?

Subject: save timeseries to file

From: ade77

Date: 9 Feb, 2010 20:08:04

Message: 4 of 6

"Bastian " <bastianschmidt@trentu.removethistext.ca> wrote in message <hkseev$lb1$1@fred.mathworks.com>...
> "Oleg Komarov" <oleg.komarovRemove.this@hotmail.it> wrote in message <hksb9p$pui$1@fred.mathworks.com>...
> > "Bastian " <bastianschmidt@trentu.removethistext.ca> wrote in message <hksa6l$gbf$1@fred.mathworks.com>...
> > > I would like to save timeseries objects to a file and then subsequently load them back into the workspace as timeseries. I am trying to do this to avoid having to recreate the timeseries each time I want to use them. Can this be done?
> >
> > help save
> >
> > Oleg
>
> I wish it was that simlpe. I am talking about a MATLAB timeseries object not just any old variable in the workspace (check it out: help timeseries). Any other ideas?

It is basically the same concept.
If your timeseries object is named 'my_ts'.
save('myfile','my_ts');
this will save the timeseries object 'my_ts' inside myfile.mat in the default directory.
Hence,
save('myfile','my_ts');
load myfile % will bring back your timeseries 'my_ts', in the workspace

Subject: save timeseries to file

From: Bastian

Date: 9 Feb, 2010 21:15:22

Message: 5 of 6

"ade77 " <ade100a@gmail.com> wrote in message <hksfb4$iq2$1@fred.mathworks.com>...
> "Bastian " <bastianschmidt@trentu.removethistext.ca> wrote in message <hkseev$lb1$1@fred.mathworks.com>...
> > "Oleg Komarov" <oleg.komarovRemove.this@hotmail.it> wrote in message <hksb9p$pui$1@fred.mathworks.com>...
> > > "Bastian " <bastianschmidt@trentu.removethistext.ca> wrote in message <hksa6l$gbf$1@fred.mathworks.com>...
> > > > I would like to save timeseries objects to a file and then subsequently load them back into the workspace as timeseries. I am trying to do this to avoid having to recreate the timeseries each time I want to use them. Can this be done?
> > >
> > > help save
> > >
> > > Oleg
> >
> > I wish it was that simlpe. I am talking about a MATLAB timeseries object not just any old variable in the workspace (check it out: help timeseries). Any other ideas?
>
> It is basically the same concept.
> If your timeseries object is named 'my_ts'.
> save('myfile','my_ts');
> this will save the timeseries object 'my_ts' inside myfile.mat in the default directory.
> Hence,
> save('myfile','my_ts');
> load myfile % will bring back your timeseries 'my_ts', in the workspace

Thanks ade77. That works. I appreciate you patiently pointing out the obvious need for putting the single quotes around the timeseries name... I read the help on "save" (as suggested by Oleg) but for some reason I missed this obvious fact. I am always thrown off by how MATLAB requires strings for arguments for some functions but not others.

Subject: save timeseries to file

From: Oleg Komarov

Date: 10 Feb, 2010 00:15:23

Message: 6 of 6

"Bastian " <bastianschmidt@trentu.removethistext.ca> wrote in message <hksj9a$36m$1@fred.mathworks.com>...
> "ade77 " <ade100a@gmail.com> wrote in message <hksfb4$iq2$1@fred.mathworks.com>...
> > "Bastian " <bastianschmidt@trentu.removethistext.ca> wrote in message <hkseev$lb1$1@fred.mathworks.com>...
> > > "Oleg Komarov" <oleg.komarovRemove.this@hotmail.it> wrote in message <hksb9p$pui$1@fred.mathworks.com>...
> > > > "Bastian " <bastianschmidt@trentu.removethistext.ca> wrote in message <hksa6l$gbf$1@fred.mathworks.com>...
> > > > > I would like to save timeseries objects to a file and then subsequently load them back into the workspace as timeseries. I am trying to do this to avoid having to recreate the timeseries each time I want to use them. Can this be done?
> > > >
> > > > help save
> > > >
> > > > Oleg
> > >
> > > I wish it was that simlpe. I am talking about a MATLAB timeseries object not just any old variable in the workspace (check it out: help timeseries). Any other ideas?
> >
> > It is basically the same concept.
> > If your timeseries object is named 'my_ts'.
> > save('myfile','my_ts');
> > this will save the timeseries object 'my_ts' inside myfile.mat in the default directory.
> > Hence,
> > save('myfile','my_ts');
> > load myfile % will bring back your timeseries 'my_ts', in the workspace
>
> Thanks ade77. That works. I appreciate you patiently pointing out the obvious need for putting the single quotes around the timeseries name... I read the help on "save" (as suggested by Oleg) but for some reason I missed this obvious fact.

"I am always thrown off by how MATLAB requires strings for arguments for some functions but not others. "

I do completely agree with you.

Oleg

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
saving file B. Schmidt 9 Feb, 2010 13:44:05
timeseries B. Schmidt 9 Feb, 2010 13:44:04
rssFeed for this Thread

Contact us at files@mathworks.com