Thread Subject: Getting the list of currently opened models?

Subject: Getting the list of currently opened models?

From: checker i

Date: 16 Nov, 2009 15:59:03

Message: 1 of 4

Hello guys,

Just wondering if there is any matlab command that will list all the currently opened models in the current session.

Thanks

Subject: Getting the list of currently opened models?

From: Donn Shull

Date: 16 Nov, 2009 17:29:03

Message: 2 of 4

"checker i" <checker.im@gmail.com> wrote in message <hdrss7$pjk$1@fred.mathworks.com>...
> Hello guys,
>
> Just wondering if there is any matlab command that will list all the currently opened models in the current session.
>
> Thanks

The models are all children of Simulink.Root so you could do something like:

children = getChildren(slroot);

for index = 1:numel(children)
    disp(children(index).getFullName);
end

Good luck,

Donn

Subject: Getting the list of currently opened models?

From: checker i

Date: 16 Nov, 2009 17:39:03

Message: 3 of 4

"Donn Shull" <donn.shull.no_spam@aetoolbox.com> wrote in message <hds24v$sf0$1@fred.mathworks.com>...
> "checker i" <checker.im@gmail.com> wrote in message <hdrss7$pjk$1@fred.mathworks.com>...
> > Hello guys,
> >
> > Just wondering if there is any matlab command that will list all the currently opened models in the current session.
> >
> > Thanks
>
> The models are all children of Simulink.Root so you could do something like:
>
> children = getChildren(slroot);
>
> for index = 1:numel(children)
> disp(children(index).getFullName);
> end
>
> Good luck,
>
> Donn

Thanks a lot Don, that worked

Subject: Getting the list of currently opened models?

From: Gavin Walker

Date: 17 Nov, 2009 10:34:36

Message: 4 of 4

"Donn Shull" <donn.shull.no_spam@aetoolbox.com> wrote in message
news:hds24v$sf0$1@fred.mathworks.com...
> "checker i" <checker.im@gmail.com> wrote in message
> <hdrss7$pjk$1@fred.mathworks.com>...
>> Hello guys,
>>
>> Just wondering if there is any matlab command that will list all the
>> currently opened models in the current session.
>>
>> Thanks
>
> The models are all children of Simulink.Root so you could do something
> like:
>
> children = getChildren(slroot);
>
> for index = 1:numel(children)
> disp(children(index).getFullName);
> end


That will find the currently loaded models, but will also find other
Simulink-related items as well, such as configuration sets.

find_system is a useful command to find all the currently loaded models:

>> open_bd = find_system('type', 'block_diagram')

It also allows more complex searches -- for example, if you really do want
the currently OPEN models rather than all the models that are loaded and in
memory:

>> open_system({'vdp','f14'}) % open these models
>> load_system('sf_car') % load these models but do not open them for
>> editting
>> open_bd = find_system('type', 'block_diagram','open','on')

open_bd =

    'f14'
    'vdp'

>> loaded_bd = find_system('type', 'block_diagram','open','off')

open_bd =

    'sf_car'

>> all_bd = find_system('type', 'block_diagram')

open_bd =

    'sf_car'
    'f14'
    'vdp'


HTH,

Gavin

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
command line checker i 16 Nov, 2009 11:04:04
simulink models checker i 16 Nov, 2009 11:04:04
rssFeed for this Thread

Contact us at files@mathworks.com