overwrite an existing GUI

조회 수: 3 (최근 30일)
Metin
Metin 2013년 8월 31일
good night everybody, is there anyone that knows anyfunction to count number of opened graphs because in my GUI, in the 1st interfaace I have a pusbutton and it is generating variables on another interface depends on the values entered by the user. When user wants to generate any other variables I want to overwrite the existing one so I guess it maybe possible to know the amount of figures and close all except 1st one, or how can I overwrite an existing table, I could not check the handle of table because handle is erased just after creation or not exist before execution for any suggestion thanks in advance good weekends

채택된 답변

Walter Roberson
Walter Roberson 2013년 9월 1일
figurehandles = findall(0, '-type', 'figure');
number_of_figures_open = length(figurehandles);
  댓글 수: 4
Metin
Metin 2013년 9월 1일
good morning, yes it wright but for my program still I could't reach the point what I want because as by pushing button I want to generate the variable table on the previous one to prevent many figures on the screen, and with this comment as I have to check number of figures before generation I lose my actual handle and because of function itself not possible to assign another value to the result of findall, there has to any other simple solution to overwrite an already existing figure but I don't know, for any other further suggestion thanks in advance
Walter Roberson
Walter Roberson 2013년 9월 1일
Have you considered tagging the graphic object you want to write into?
For example if you put all the relevant objects into a uipanel, then at the time of creation,
set(HandleOfUiPanel, 'Tag', 'ResultsPanel');
and then when you want to find it again,
HandleOfUiPanel = findobj(0, 'Tag', 'ResultsPanel');
if isempty(HandleOfUiPanel)
%oh... it doesn't exist at the moment! Recreate it?
end

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by