Thread Subject: how to save data only during specified interval?

Subject: how to save data only during specified interval?

From: peter yamo

Date: 14 Jun, 2008 00:31:04

Message: 1 of 5

I am running long simulations, say 30 simulated seconds. Could anybody please
let me know how to save all the data, say only from the 25-28th simulated
seconds? Can this method be applied to the scope/"to workspace"/"to file"
blocks? Thanks.

Subject: how to save data only during specified interval?

From: Devdatt Lad

Date: 16 Jun, 2008 14:34:41

Message: 2 of 5

peter yamo wrote:
> I am running long simulations, say 30 simulated seconds. Could anybody please
> let me know how to save all the data, say only from the 25-28th simulated
> seconds? Can this method be applied to the scope/"to workspace"/"to file"
> blocks? Thanks.

Put your Sink block inside an enabled subsystem and provide an enable
signal that is high at those times of interest.

--
Devdatt Lad
The MathWorks, Inc.

Subject: how to save data only during specified interval?

From: peter yamo

Date: 30 Jun, 2008 04:20:18

Message: 3 of 5

Devdatt Lad <Devdatt.Lad@mathworks.com> wrote in message
<g35tm1$jn9$1@fred.mathworks.com>...
> peter yamo wrote:
> > I am running long simulations, say 30 simulated seconds. Could anybody
please
> > let me know how to save all the data, say only from the 25-28th
simulated
> > seconds? Can this method be applied to the scope/"to workspace"/"to
file"
> > blocks? Thanks.
>
> Put your Sink block inside an enabled subsystem and provide an enable
> signal that is high at those times of interest.
>
> --
> Devdatt Lad
> The MathWorks, Inc.

I have been trying to do this but it still does not work. I also tried triggered
subsystem and if subsystem but no luck. For example, I have one of these
subsystem in between a joint block and a "To workspace" block. I still get the
joint data during the entire simulation even I specified that the data be saved
to workspace only during a shorter time period. Perhaps I misunderstood
something. Could you please provide an example?

Subject: how to save data only during specified interval?

From: Devdatt Lad

Date: 1 Jul, 2008 12:48:09

Message: 4 of 5

peter yamo wrote:
> ... For example, I have one of these
> subsystem in between a joint block and a "To workspace" block. I still get the
> joint data during the entire simulation even I specified that the data be saved
> to workspace only during a shorter time period.

The To Workspace block must be inside the enable subsystem. Thus you
would have a Joint Block's signal output connected to the input of the
enabled subsystem. Now, inside the enabled subsystem, the inport block
should be connected to a To Workspace block.

--
Devdatt Lad
The MathWorks, Inc.

Subject: how to save data only during specified interval?

From: peter yamo

Date: 6 Jul, 2008 12:09:02

Message: 5 of 5

Devdatt Lad <Devdatt.Lad@mathworks.com> wrote in message
<g4d929$imi$1@fred.mathworks.com>...
> peter yamo wrote:
> > ... For example, I have one of these
> > subsystem in between a joint block and a "To workspace"
block. I still get the
> > joint data during the entire simulation even I
specified that the data be saved
> > to workspace only during a shorter time period.
>
> The To Workspace block must be inside the enable
subsystem. Thus you
> would have a Joint Block's signal output connected to the
input of the
> enabled subsystem. Now, inside the enabled subsystem, the
inport block
> should be connected to a To Workspace block.
>
> --
> Devdatt Lad
> The MathWorks, Inc.

Thank you. It is working now.

Tags for this Thread

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.

rssFeed for this Thread

Contact us at files@mathworks.com