MATLAB Answers

Andy
0

MATLAB command line control of Simulink signal builder

Asked by Andy
on 24 Jan 2013
Latest activity Answered by Tonelli
on 17 May 2015
Hi All,
I have a Simulink model that contains a signal builder that has 3 groups of signals. What I want to be able to do is simulate the model from a Matlab m-file for each group of signals. i.e. I will use the sim command 3 times to simulate the model 3 times, but before each time I use the sim command I need to be able to set the active group of signals in the signal builder. Is there any way to do this without have the model file open i.e. run the m-file but not open the .mdl file? Any help is greatly appreciated.
regards,
Andrew

  0 Comments

Sign in to comment.

5 Answers

Answer by Andreas Goser on 24 Jan 2013
 Accepted Answer

I found an internal knowledgebase document about a similar question. You might need to contact technical support for more information referring to "solution 1-C3IKN1". It also says this is possible with R2012b and MathWorks can provide a woraround for older releases, but I am not too fmailiar with this matter and - again - suggest you contact technical support.

  1 Comment

Note: I assume you still need to open the model but not run it.

Sign in to comment.


Answer by Kaustubha Govind on 24 Jan 2013

  0 Comments

Sign in to comment.


Answer by Andy
on 24 Jan 2013

Thanks for the suggestions.
Andreas: have contacted technical support and we are in the process of finding a solution.
Kaustubha: Unfortunately that doesnt work for me because it requires the model to already be open to be able to execute that command. I have managed to get round it by using a load_system command on the line before, however I was hoping that I wouldnt have to use this because it adds a fair amount of time onto the execution time of the m-file (note: I need to use this technique inside many many m-files therefore if it adds an extra 3 seconds to the length of the script then it may cost me an extra 10 mins to execute them all time). I fear however that this may be the only way to do this, but I will wait to see what technical support come up with.
Many thanks for your help so far.
Andy

  0 Comments

Sign in to comment.


Answer by Albert Yam
on 24 Jan 2013

Do you have to use a Signal builder? If you use a lookup table that references a variable 'mysignal' in the workspace, then redefine that 'mysignal' each time before running.

  0 Comments

Sign in to comment.


Answer by Tonelli
on 17 May 2015

Hi everybody, I can´t customize the name of the test cases of a signal builder created using a script. The "default name GROUPxx" is always taken as a reference. My goal would be to use a string digited by the user as a default name for the signal builder (i.e: test_case_A (from keyboard) --> Signal builder= test_case_A_1).
SBSystem = signalbuilder([ModelName,'/', SBName], 'create', [0 simulationTime], [0 0], char(ModelTLNameInport{1}), 'Test_COMPONENT_UNIT_Fctl_001');
(basically "Test_COMPONENT_UNIT_Fctl_001" must become the string given by the user).
Thanks a lot in advance. Regards

  0 Comments

Sign in to comment.