Hi,
In a script, I was checking the existence of a plot handle to either make a new plot or to change the x/y data. Surprisingly this didn't work by initially setting the plot handle to []. Reason:
>> ishandle( [] )
ans =
[]
which sort of makes sense.
However, my next step was to initialise the plot handle to 0, which also didn't work, and this was the real surprise:
>> ishandle( 0 )
ans =
1
Even though
>> ishandle( 1 )
ans =
0
Does anybody why zero would be a valid graphics or Java object handle?
Thanks,
Temu

댓글 수: 1

Temu Gautama
Temu Gautama 2019년 11월 22일
I forgot to check the forum. Apparently, 0 is the root handle.
Temu

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

 채택된 답변

Stephen23
Stephen23 2019년 11월 22일
편집: Stephen23 2019년 11월 22일

0 개 추천

On MATLAB versions prior to R2016b zero is the handle to the graphics root (i.e. the parent of all graphics figures):
For compatilbility using zero is still permitted in later versions.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품

릴리스

R2015b

태그

질문:

2019년 11월 22일

편집:

2019년 11월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by