Filter löschen
Filter löschen

How do I refresh data in an axes in Matlab GUI?

3 Ansichten (letzte 30 Tage)
Abhay Aradhya
Abhay Aradhya am 8 Jun. 2017
Kommentiert: Adam am 8 Jun. 2017
I am trying to update a graph every time the value of variable "sectors_all" changes or the button "select" is pressed.
How do I change the data on the graph without creating a new UI every time?
userInterface = figure('Name','Solution selector window');
flightDataPlotPosition = [.1 .5 .375 .4];
ax = axes('Parent',userInterface,'Position',flightDataPlotPosition);
hold on
subplot(ceil(sqrt(size(sectors_all,1))),ceil(sqrt(size(sectors_all,1))),1, 'Position',flightDataPlotPosition);
hold on;
topPanel = uipanel(userInterface,...
'Position',[0 .95 1 .05]);
% Code for select button in the top panel
selectButton = uicontrol('Parent',topPanel,'Style','pushbutton','String',"Select",...
'Units','normalized',...
'Position',[.325 .25 .05 .5],...
'Callback', @selectSolution);
% callback function for select button in the top panel
function selectSolution(source,event)
display('select button pressed')
end
  1 Kommentar
Adam
Adam am 8 Jun. 2017
You don't seem to be actually plotting any data in that code, just creating a subplot axes.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Specifying Target for Graphics Output finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by