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

조회 수: 2 (최근 30일)
Tejas Rivonkar
Tejas Rivonkar 2020년 1월 15일
% 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에서 Simulink Functions에 대해 자세히 알아보기

제품


릴리스

R11.1

Community Treasure Hunt

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

Start Hunting!

Translated by