|
"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
|