필터 지우기
필터 지우기

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

조회 수: 3 (최근 30일)
Abhay Aradhya
Abhay Aradhya 2017년 6월 8일
댓글: Adam 2017년 6월 8일
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
Adam
Adam 2017년 6월 8일
You don't seem to be actually plotting any data in that code, just creating a subplot axes.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by