Home > Archive > Matlab > June 2007 > block: close scopes
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
block: close scopes
|
|
|
| Hello,
I would like to create in my model a block to close all open scopes
after running my model. Can anyone help me? Thaks a lot!
Ruth
| |
|
| Hi Ruth,
- add an empty subsystem
- right click->Block properties->Callbacks->OpenFcn, add:
set(0,'ShowHiddenHandles', 'on')
close(findobj(0,'type', 'figure', 'tag','SIMULINK_SIMSCOPE_FIGURE'))
set(0,'ShowHiddenHandles', 'off')
That should do the trick. You may mask the subsystem and add some
disp('Close Scopes') for the icon display
Titus
"Ruth" <rmp.delrio@gmail.com> schrieb im Newsbeitrag
news:ef59e43.-1@webcrossing.raydaftYaTP...
> Hello,
>
> I would like to create in my model a block to close all open scopes
> after running my model. Can anyone help me? Thaks a lot!
>
> Ruth
| |
|
| Hello Titus!
Sorry, but it doesn't work. I have tried writting the name of my
model instead of 'SIMULINK_SIMSCOPE_FIGURE'.. but nothing.. Must I
change any parameter depending on how I've called my model or
something like that?
Thanks!!!!
Titus wrote:
>
>
> Hi Ruth,
>
> - add an empty subsystem
> - right click->Block properties->Callbacks->OpenFcn, add:
>
> set(0,'ShowHiddenHandles', 'on')
> close(findobj(0,'type', 'figure',
> 'tag','SIMULINK_SIMSCOPE_FIGURE'))
> set(0,'ShowHiddenHandles', 'off')
>
> That should do the trick. You may mask the subsystem and add some
> disp('Close Scopes') for the icon display
>
> Titus
>
>
> "Ruth" <rmp.delrio@gmail.com> schrieb im Newsbeitrag
> news:ef59e43.-1@webcrossing.raydaftYaTP...
> scopes
>
>
>
| |
|
| Hi Ruth,
which version of MATLAB are you using?
Titus
"Ruth" <rmp.delrio@gmail.com> schrieb im Newsbeitrag
news:ef59e43.1@webcrossing.raydaftYaTP...[color=darkred]
> Hello Titus!
>
> Sorry, but it doesn't work. I have tried writting the name of my
> model instead of 'SIMULINK_SIMSCOPE_FIGURE'.. but nothing.. Must I
> change any parameter depending on how I've called my model or
> something like that?
>
> Thanks!!!!
>
> Titus wrote:
| |
|
|
|
| Hi Ruth,
O.K., there is a much easier (and better) way:
scopeBlocks = find_system(bdroot(gcb), 'BlockType', 'Scope');
for i=1:length(scopeBlocks)
set_param(scopeBlocks{i}, 'Open','off')
end
Titus
"Ruth" <rmp.delrio@gmail.com> schrieb im Newsbeitrag
news:ef59e43.3@webcrossing.raydaftYaTP...
> Matlab 7.1
|
|
|
|
|