Simulink

1 次查看(过去 30 天)
asha jyothi
asha jyothi 2012-3-31
How can i multiple 's' to the gain(K) in feedback of my block diagram? I get the value of gain(K) from GUI window.
  1 个评论
TAB
TAB 2012-4-3
Plaese explore your question. It has very less information.

请先登录,再进行评论。

回答(1 个)

K E
K E 2012-4-2
The set_param function can be used to set a value such as a gain. Here is an example. The gain value supplied to set_param must be a string, not a number.
for iGain = 1:length(listOfGainValues)
strGain = num2str(listOfGainValues(iGain)) ;
set_param('yourModel/yourBlock/Gain', 'Gain', strGain) ;
% Run your simulation here with this gain value
end
  2 个评论
asha jyothi
asha jyothi 2012-4-2
thanks for your reply.
basically, my question is not about using the gain from code. but its about how can i multiply 's' to the gain(k) in simulink.
K E
K E 2012-4-3
Can you please explain? Do you want your GUI to increase the gain prior to simulation, or do you want to add a block that increases the gain by a factor of s during the simulation, or...?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by