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

2 visualizaciones (últimos 30 días)
Tejas Rivonkar
Tejas Rivonkar el 15 de En. de 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.

Respuestas (0)

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Etiquetas

Productos


Versión

R11.1

Community Treasure Hunt

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

Start Hunting!

Translated by