Value of handles.axes in MATLAB GUI

1 回表示 (過去 30 日間)
Chethan
Chethan 2013 年 4 月 27 日
What value will get stored in handles.axes if image is present and if the image is not present? I want check the condition whether image is present or not, and i implemented this
if handles.axes1==0
msgbox('Please insert image. . .', 'Error. . .');
end
but this is not working, please suggest me the best way of doing this.

採用された回答

Walter Roberson
Walter Roberson 2013 年 4 月 27 日
You could try
if ~ishandle(handles.axes1)
However, if the axes exists but does not contain an image, the axes will still be a handle. But you can test
if isempty(findobj(handles.axes1, 'type', 'image'))
to see whether the axes contains an image
  1 件のコメント
Chethan
Chethan 2013 年 4 月 27 日
Thank you and it is working, but what does 'type' indicates in above code?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by