Is there a way to call a plot createFcn from another function in a GUI?

조회 수: 8 (최근 30일)
Pavan
Pavan 2017년 9월 1일
편집: Pavan 2017년 9월 1일
I have a GUI with an embedded plot. I generated a createFcn for this plot using GUIDE. Is there a way I can call this function from another function inside the same m file? This is what I tried and I get an error:
energyDiagram_CreateFcn(handles.energyDiagram, eventdata, handles);
Ideal solution will be to assign a handle to the figure in this CreateFcn that I can reference from outside. But I do not know the syntax for that.
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2017년 9월 1일
Pavan - why do you want to do this? The _CreateFcn should be called automatically when you launch the GUI and so I don't think that you ever want to call it yourself for any reason. Please describe why you think that this is necessary.
Pavan
Pavan 2017년 9월 1일
편집: Pavan 2017년 9월 1일
Hello Geoff, Thank you for replying. I am trying to plot stuff on it based on the user input in the GUI. Once I have all the input I need, I am inserting the above code in a pushbutton to update the plot. Is there a much better way to do this?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by