早教吧作业答案频道 -->其他-->
英语翻译f Gain from the sliderNewVal = get(hObject,"Value");% Set the value of the KfCurrentValue to the new value set by sliderset(handles.KfCurrentValue,"String",NewVal)% Set the Gain parameter of the Kf Gain Block to the new valueset_param("f1
题目详情
英语翻译
f Gain from the slider
NewVal = get(hObject,'Value');
% Set the value of the KfCurrentValue to the new value set by
slider
set(handles.KfCurrentValue,'String',NewVal)
% Set the Gain parameter of the Kf Gain Block to the new value
set_param('f14/Controller/Gain','Gain',num2str(NewVal))
Note that,while a slider returns a number and the edit text requires a string,uicontrols automatically convert the values to the correct type.The callback for the Integral (Ki) slider follows a similar approach.Current Value Edit Text CallbackThe edit text box enables users to type in a value for the respective parameter.When the user clicks on another component in the GUI after typing into the text box,the edit text callback executes the following steps:Calls model_open to ensure that the Simulink model is open so that it can set simulation parameters.Converts the string returned by the edit box String property to a double (str2double).Checks whether the value entered by the user is within the range of the slider:If the value is out of range,the edit text String property is set to the value of the slider (rejecting the number typed in by the user).If the value is in range,the slider Value property is updated to the new value.Sets the appropriate block parameter to the new value (set_param).Here is the callback for the Kf Current value text box.function KfCurrentValue_Callback(hObject,eventdata,handles)
% Ensure model is open
model_open(handles)
% Get the new value for the Kf Gain
NewStrVal = get(hObject,'String');
NewVal = str2double(NewStrVal);
% Check that the entered value falls within the allowable range
if isempty(NewVal) | (NewVal< -5) | (NewVal>0),
% Revert to last value,as indicated by KfValueSlider
OldVal = get(handles.KfValueSlider,'Value');
set(hObject,'String',OldVal)
else,% Use new Kf value
% Set the value of the KfValueSlider to the new value
set(handles.KfValueSlider,'Value',NewVal)
% Set the Gain parameter of the Kf Gain Block to the new value
set_param('f14/Controller/Gain','Gain',NewStrVal)
end
The callback for the Ki Current value follows a similar approach.
f Gain from the slider
NewVal = get(hObject,'Value');
% Set the value of the KfCurrentValue to the new value set by
slider
set(handles.KfCurrentValue,'String',NewVal)
% Set the Gain parameter of the Kf Gain Block to the new value
set_param('f14/Controller/Gain','Gain',num2str(NewVal))
Note that,while a slider returns a number and the edit text requires a string,uicontrols automatically convert the values to the correct type.The callback for the Integral (Ki) slider follows a similar approach.Current Value Edit Text CallbackThe edit text box enables users to type in a value for the respective parameter.When the user clicks on another component in the GUI after typing into the text box,the edit text callback executes the following steps:Calls model_open to ensure that the Simulink model is open so that it can set simulation parameters.Converts the string returned by the edit box String property to a double (str2double).Checks whether the value entered by the user is within the range of the slider:If the value is out of range,the edit text String property is set to the value of the slider (rejecting the number typed in by the user).If the value is in range,the slider Value property is updated to the new value.Sets the appropriate block parameter to the new value (set_param).Here is the callback for the Kf Current value text box.function KfCurrentValue_Callback(hObject,eventdata,handles)
% Ensure model is open
model_open(handles)
% Get the new value for the Kf Gain
NewStrVal = get(hObject,'String');
NewVal = str2double(NewStrVal);
% Check that the entered value falls within the allowable range
if isempty(NewVal) | (NewVal< -5) | (NewVal>0),
% Revert to last value,as indicated by KfValueSlider
OldVal = get(handles.KfValueSlider,'Value');
set(hObject,'String',OldVal)
else,% Use new Kf value
% Set the value of the KfValueSlider to the new value
set(handles.KfValueSlider,'Value',NewVal)
% Set the Gain parameter of the Kf Gain Block to the new value
set_param('f14/Controller/Gain','Gain',NewStrVal)
end
The callback for the Ki Current value follows a similar approach.
▼优质解答
答案和解析
拜托.这不是英语 这是程序好不好 %后面的是注释
这应该是一种面向对象的语言.
你就是让老外过来看 也不一定能看懂啊
这应该是一种面向对象的语言.
你就是让老外过来看 也不一定能看懂啊
看了 英语翻译f Gain fro...的网友还看了以下:
1:如图,用与竖直方向成30度角的力F将重为10N的物体推靠在光滑的竖直墙上,求当物体沿着墙匀速滑 2020-04-27 …
有首字母补单词 The worst traveler in the world was Pau有首 2020-05-14 …
1.Given is the function f(x) =根号下(5x + 4)Calculat 2020-05-16 …
请找出函数f(x,y)=ln(x^2+y^2)在点(2,1)位于矢量v=(-1,2)的方向的方向导 2020-05-16 …
英语翻译I. Decide whether the following statements ar 2020-05-17 …
一个关于求导数的答案不明白的地方求f(x)=2x^2+x-1(x>0)的反函数在x=2处的切线的斜 2020-06-06 …
设函数f(x)在x=0处连续,下列命题错误的是()A.若limx→0f(x)x存在,则f(0)=0 2020-06-12 …
已知函数.其中.(1)若曲线y=f(x)与y=g(x)在x=1处的切线相互平行,求两平行直线间的距 2020-07-21 …
物理学中滑动摩擦力的大小计算公式为f=μN,式中μ叫动摩擦因素,N为正压力,现有一物体G受到向右水 2020-08-02 …
1.firstofGreatWallwasbuiltduringSpringandAutumnPe 2020-08-04 …