time | calls | line |
---|
| | 1 | function isSL = isslhandle(h)
|
| | 2 | %ISSLHANDLE True for Simulink object handles for models or subsystem.
|
| | 3 | % ISSLHANDLE(H) returns an array that contains 1's where the elements of
|
| | 4 | % H are valid printable Simulink object handles and 0's where they are not.
|
| | 5 |
|
| | 6 | % Copyright 1984-2008 The MathWorks, Inc.
|
| | 7 |
|
| 54 | 8 | narginchk(1,1)
|
| | 9 |
|
| | 10 | %See if it is a handle of some kind
|
| 54 | 11 | isSL = ~ishghandle(h);
|
| 54 | 12 | for i = 1:length(h(:))
|
| 54 | 13 | if isSL(i)
|
| | 14 | %If can not GET the Type of the object then it is not an HG object.
|
| | 15 | try
|
| | 16 | %Use EVALC to suppress an error message when Simulink isn't fully installed.
|
| | 17 | evalc('t = get_param(h(i),''type'');');
|
| | 18 | isSL(i) = strcmp( 'block_diagram', get_param( h(i), 'type' ) );
|
| | 19 | if ~isSL(i)
|
| | 20 | isSL(i) = strcmp( 'SubSystem', get_param( h(i), 'blocktype' ) );
|
| | 21 | end
|
| | 22 | catch ex
|
| | 23 | isSL(i) = false;
|
| | 24 | end
|
| | 25 | end
|
| 54 | 26 | end
|