Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
Abhay Aradhya
Abhay Aradhya le 8 Juin 2017
Commenté : Adam le 8 Juin 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 commentaire
Adam
Adam le 8 Juin 2017
You don't seem to be actually plotting any data in that code, just creating a subplot axes.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Specifying Target for Graphics Output dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by