Comments on: Searching in Simulink https://blogs.mathworks.com/simulink/2008/03/04/searching-in-simulink/?s_tid=feedtopost Guy Rouleau is an Application Engineer for MathWorks. He writes here about Simulink and other MathWorks tools used in Model-Based Design. Fri, 20 Apr 2012 20:24:28 +0000 hourly 1 https://wordpress.org/?v=6.2.2 By: K https://blogs.mathworks.com/simulink/2008/03/04/searching-in-simulink/#comment-1801 Fri, 20 Apr 2012 20:24:28 +0000 https://blogs.mathworks.com/seth/2008/03/04/searching-in-simulink/#comment-1801 As a continuation of @K(24),

After some digging I’ve come up with the following:

find_system(sys,’findall’,’on’,’type’,’line’,’SrcBlockHandle’,sbh)

It can be used either with SrcBlockHandle or SrcPortHandle to find the desired line.

]]>
By: K https://blogs.mathworks.com/simulink/2008/03/04/searching-in-simulink/#comment-1800 Fri, 20 Apr 2012 13:23:42 +0000 https://blogs.mathworks.com/seth/2008/03/04/searching-in-simulink/#comment-1800 Seth hello,

Is there a way to exploit find_system to find a simulink line connecting two blocks (say with the blocks port handles at hand)?

K

]]>
By: Seth Popinchalk https://blogs.mathworks.com/simulink/2008/03/04/searching-in-simulink/#comment-1279 Fri, 29 Oct 2010 12:48:05 +0000 https://blogs.mathworks.com/seth/2008/03/04/searching-in-simulink/#comment-1279 @U N Bharathiraja – Thanks for the answer. I am always amazed at what can be done with regular expressions.

]]>
By: U N Bharathiraja https://blogs.mathworks.com/simulink/2008/03/04/searching-in-simulink/#comment-1269 Fri, 22 Oct 2010 07:52:02 +0000 https://blogs.mathworks.com/seth/2008/03/04/searching-in-simulink/#comment-1269 Hi!,

The answer for the question asked by Seth.

Challenge:
How would you find blocks that have MaskHelp without specifying the value it is set to?
Answer:

blksWithHelp = find_system(gcs,'RegExp','on','MaskHelp','.+')

find_system could be used with regular expressions constraints as well. If ‘on’, search treats search expressions as regular expressions. The default is ‘off’.

“.+” expects atleast one character in the MaskHelp.

Regards,
Bharathiraja.

]]>
By: Lorenzo https://blogs.mathworks.com/simulink/2008/03/04/searching-in-simulink/#comment-904 Wed, 25 Nov 2009 13:51:29 +0000 https://blogs.mathworks.com/seth/2008/03/04/searching-in-simulink/#comment-904 Hello!
I have to change the DECIMATION of ‘To Workspace’ block in my libraries (and I have a lot of this blocks in my libraries…)
How I can do this from command line (with find_system I think…but I don’t know how…)?

Thank you.

]]>
By: Mike Tocci https://blogs.mathworks.com/simulink/2008/03/04/searching-in-simulink/#comment-902 Mon, 23 Nov 2009 12:21:15 +0000 https://blogs.mathworks.com/seth/2008/03/04/searching-in-simulink/#comment-902 Hi Ben,

What version are you using? I just tried this on the demo model sl_subsys_enab1 in 9a and got,

find_system(‘sl_subsys_enab1’, ‘FollowLinks’,’on’, ‘LookUnderMasks’,’all’, ‘BlockType’,’SubSystem’)
ans =
‘sl_subsys_enab1/ Subsystem
definitions’
‘sl_subsys_enab1/enab1’
‘sl_subsys_enab1/enab2’

The one thing I can think of is that “gcs” is not pointing to the model you think it is. If you enter the full model name, does it still not work?

Mike

]]>
By: Ben Brown https://blogs.mathworks.com/simulink/2008/03/04/searching-in-simulink/#comment-901 Mon, 23 Nov 2009 05:48:23 +0000 https://blogs.mathworks.com/seth/2008/03/04/searching-in-simulink/#comment-901 The following does not appear to find enabled subsystems!

find_system(gcs, ‘FollowLinks’,’on’, ‘LookUnderMasks’,’all’, ‘BlockType’,’SubSystem’)

I realize these subsystems have dual identities but I would have expected this to work. Is there a magic argument to find_system to get the expected behavior?

]]>
By: Peter Raeth https://blogs.mathworks.com/simulink/2008/03/04/searching-in-simulink/#comment-640 Mon, 22 Dec 2008 18:37:55 +0000 https://blogs.mathworks.com/seth/2008/03/04/searching-in-simulink/#comment-640 Greetings Seth.

The thread above leads us in a direction we really need to go.

We have a need to retrieve a list of signal names and their associated dimensions from an existing compound bus. The retrived information should be in the form of something that cam be copy/pasted in text form.

Reading the above thread, we can see that the following commands yield a list of all lines in a model. How can we get the list of lines within a specific compound bus and get the format of each line?

allLines = find_system(‘Dimensions’, ‘FollowLinks’, ‘on’, ‘LookUnderMasks’, ‘All’, ‘FindAll’, ‘on’, ‘Type’, ‘line’)

lineNames = get_param(allLines, ‘Name’)

Thank you for whatever insights you can offer.

Best,

Peter.

]]>
By: Raja https://blogs.mathworks.com/simulink/2008/03/04/searching-in-simulink/#comment-629 Fri, 05 Dec 2008 12:24:52 +0000 https://blogs.mathworks.com/seth/2008/03/04/searching-in-simulink/#comment-629 Dear Seth

I have been in Matlab for the past one month .
Can u tell me what is LineChildren is all about.
I don have any idea about this.

]]>
By: ali https://blogs.mathworks.com/simulink/2008/03/04/searching-in-simulink/#comment-578 Thu, 16 Oct 2008 11:02:01 +0000 https://blogs.mathworks.com/seth/2008/03/04/searching-in-simulink/#comment-578 dear seth,
i would like to design PID controller in matlab/simulink for control the process trainer.
please help.
i think my designed was wrong….

]]>