How can I select the output of WaveFormGenerator Simulink block from a script?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I am using the block WaveFormGenerator from simulink, I see that the Output Signal can be selected during the simulation according to the documentation, so I was wondering whether or not it is possible to select that output from a initial script that will launch my simulation.
Any suggestions if this is achievable?
Thanks in advance,
REgards
댓글 수: 0
채택된 답변
Kushagr Gupta
2016년 11월 8일
I understand that the Programmatic (command-line) way to select a signal output of a WaveFormGenerator is being asked for.
It is possible to select signals before the simulation starts and after a simulation has ended but not during the time when simulation is running.
By using the 'get_param' one can change and select signals as required. Following is a code snippet on how to do so:
>> WaveFormBlk = gcb %path to the WaveformGenerator block in model (Can select the block and use gcb or give the ExactPath to the block as a string)
>> get_param(WaveFormBlk,'selectedSignal')
% returns the present selected signal
>> set_param(WaveFormBlk,'selectedSignal','4')
% Change the selection to 4, Third argument has to be a string containing a number representing which signal to select
Hope this helps!
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!