Axes Handle Object not avaliable in GUI

조회 수: 4 (최근 30일)
Shusen
Shusen 2011년 10월 9일
Hi. I have taken some previous guy's work and continue developing. He was plotting into axes1 in a GUI without specifying which axes is the target, and it works. When I try to add "axes(handles.axes1)" before the plotting action I am getting error "Invalid object handle". When I check the value of handles.axes1 it does have a value. What could be the possible error here? How can I resolve it.

답변 (2개)

Jan
Jan 2011년 10월 9일
You cann search for "axes1" in the M-files. It should be defined anywhere. Either the author forgot to store the value and a GUIDATA must be inserted. Or the definition of axes1 is missing completely.
More precise suggestions are impossible without seeing the code.
  댓글 수: 2
Shusen
Shusen 2011년 10월 9일
OK, I think most of the time I am creating the GUI using guide. So I don't know the mechanism inside to create a graphic object handle. Everytime I insert a component the .m file will be updated.
For the current problem I searched the .m file and found no definition. Do you know how to add an axes object handle manually?
Shusen
Shusen 2011년 10월 10일
Forgot to say thank you.

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


Walter Roberson
Walter Roberson 2011년 10월 9일
If you were to check
ishandle(handles.axes1)
you would find that it says 0 (false).
Graphics handles are represented by numeric values, but when the graphics object is deleted, the numeric value is not somehow automatically cleared. The code is attempting to use an axes that no longer exists.
  댓글 수: 1
Shusen
Shusen 2011년 10월 10일
Thank you for pointing out this!
Yes, you are right even the value exist it is not a handle(even it is called handles.axes1). My problem is when I open the GUI, I can make plots on the exes area without setting a handle to it. So I see the plots. However, when I want to add another axes and control which one is currently active, I am having trouble. Do you know how to add a handles for the axes object after it is on the GUI?

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

카테고리

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