How to interface a Simulink block with slider button on GUI?

1 次查看(过去 30 天)
% function for the "slider" Load Active Power %
% The slider value is passed on the "edit text" box %
function ldR_Callback(hObject, eventdata, handles)
sliderValue = get(hObject, 'Value');
set(handles.ldvalR, 'String', num2str(sliderValue));
guidata(hObject, handles);
function ldR_CreateFcn(hObject, eventdata, handles)
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
Here is the code that i have in the GUI.
but the problem is that the slider isn't working as per the requirement.
the above code is meant to connect the load block from simulink power system domain with the GUI so that user can change the value of the load as per the necessity with actually going into the block in work space.
Can someone help me to make improvement in it?
similar code is there for inductive and capacitive power
please suggest any improvement if possible.

回答(0 个)

类别

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

产品


版本

R11.1

Community Treasure Hunt

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

Start Hunting!

Translated by