I'm trying to update p.MarkerSize using a slider bar.
a column of R is selected for a particular value on a slider bar.
manupulated variable is s, 0<s<10.
uip = uipanel(fig,'Title','Time, T','position',[0.1 0.0095 0.8 0.0972]);
uic = uicontrol(uip,'Style','slider', 'Position',[10,5,725,40], 'value', s, 'min', min(s), 'max', max(s));
bgcolor = fig.Color;
bl1 = uicontrol('Parent',uip,'Style','text','Position',[-5,20,20,15],'String','0');
bl2 = uicontrol('Parent',uip,'Style','text','Position',[735,20,20,15],'String','10');
p.MarkerSize = 30*R(:,s(1)/s(2)+1,1) + 1; % initial MarkerSize
uic.Callback = @(es,ed) updateSystem(p.MarkerSize, 30*R(:,es.Value/s(2)+1,1)+1);

3 Kommentare

Sayid Bajrai Nasir
Sayid Bajrai Nasir am 26 Mär. 2020
Bearbeitet: Sayid Bajrai Nasir am 26 Mär. 2020
note: no. of column of s is the same as R (101 columns)
Tommy
Tommy am 27 Mär. 2020
From what I can tell, updateSystem is used to update a plot's data, not a property like MarkerSize. You could try just
uic.Callback = @(es,ed) set(p, 'MarkerSize', 30*R(:,es.Value/s(2)+1,1)+1);
Sayid Bajrai Nasir
Sayid Bajrai Nasir am 27 Mär. 2020
It works!! thanks

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 26 Mär. 2020

Kommentiert:

am 27 Mär. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by