For Programmers: Free Programming Magazines  


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
Ruth

2007-06-10, 8:13 am

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
Titus

2007-06-11, 8:12 am

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



Ruth

2007-06-11, 8:12 am

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

Titus

2007-06-11, 8:12 am

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:


Ruth

2007-06-11, 8:12 am

Matlab 7.1
Titus

2007-06-11, 8:12 am

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



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com