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

1 view (last 30 days)
% 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.

Answers (0)

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products


Release

R11.1

Community Treasure Hunt

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

Start Hunting!