f



Find corresponding From blocks in a Goto Block

Hello,

is there a fast way to determine if a Goto block has corresponding
From blocks? I mean a way with simulink commands. I must find all Goto
blocks without an corresponding From block, so i can remove it.
My current solution is a brute force method that compares the TAG
infos from all Goto and From blocks.

regards
Frank

0
fpagels (3)
7/22/2008 12:43:59 PM
comp.soft-sys.matlab 211266 articles. 14 followers. lunamoonmoon (258) is leader. Post Follow

5 Replies
524 Views

Similar Articles

[PageSpeed] 5

If you have Embedded Coder then you can do this:

modelObject = get_param(modelName, 'UDDObject')
feature('EngineInterface', 1)
modelObject.getCompiledBlockList
feature('EngineInterface', 0)

this will let you know which blocks are not needed 
including GOTO blocks with no corresponding FROM blocks
0
7/22/2008 2:30:21 PM
On 22 Jul., 16:30, "Donn Shull" <donn.shull.no_s...@aetoolbox.com>
wrote:
> If you have Embedded Coder then you can do this:
>
> modelObject = get_param(modelName, 'UDDObject')
> feature('EngineInterface', 1)
> modelObject.getCompiledBlockList
> feature('EngineInterface', 0)
>
> this will let you know which blocks are not needed
> including GOTO blocks with no corresponding FROM blocks

Embedder Coder is unortunable not available for my problem.

0
fpagels (3)
7/22/2008 3:40:15 PM
Ok, I am sorry the Embedded Coder idea was not useful. I 
don't know if this idea will help or not but I would be 
interested to know if it helps.

% get a list of the From blocks
froms = find_system(bdroot, 'BlockType', 'From')
% get a list of the From tags
fromTags = get_param(froms, 'GotoTag')

% get a list of the Goto blocks
gotos = find_system(bdroot, 'BlockType', 'Goto')
% get a list of the Goto tags
gotoTags = get_param(gotos, 'GotoTag')

% get the indices of gotoTags that do not have fromTags
indices = find(~ismember(gotoTags, fromTags))

% form a list of the Goto blocks with no From blocks
unsourcedList = gotos(indices)

I hope this helps

0
7/23/2008 3:01:04 AM
Your solution works great. Thanks for that.

0
fpagels (3)
7/23/2008 7:22:54 AM
An alternative solution:

fromInfo = get(fromBlkHandle,'GotoBlock');

gotoInfo = get(gotoBlkHandle,'FromBlocks');


copper <fpagels@gmail.com> wrote in message <8538bd22-7f57-4aa7-a73a-477d4f732abd@d45g2000hsc.googlegroups.com>...
> Hello,
> 
> is there a fast way to determine if a Goto block has corresponding
> From blocks? I mean a way with simulink commands. I must find all Goto
> blocks without an corresponding From block, so i can remove it.
> My current solution is a brute force method that compares the TAG
> infos from all Goto and From blocks.
> 
> regards
> Frank
> 
0
4/2/2009 3:33:02 PM
Reply: