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

1 vue (au cours des 30 derniers jours)
Tejas Rivonkar
Tejas Rivonkar le 15 Jan 2020
% 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.

Réponses (0)

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Produits


Version

R11.1

Community Treasure Hunt

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

Start Hunting!

Translated by