MATLAB Answers

read a image in a axes

2 views (last 30 days)
hello all,
i am displaying a png image in an axes.
but i need to check whether image is present or not in the axes when i press my pushbutton. how do i do that

  0 Comments

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 10 Apr 2019
imhandles() is one way.
However, if you have the axes handle, I would suggest
findobj(TheAxesHandle, 'type', 'image')

  4 Comments

Show 1 older comment
Walter Roberson
Walter Roberson on 10 Apr 2019
if isempty(findobj(handles.axes1, 'type', 'image'))
there is no image at all in the axes
end
There is not normally any way to determine whether a particular image is present in an axes, as the image display algorithms do not record file names or variable names.
Sajid Afaque
Sajid Afaque on 10 Apr 2019
thanks walter its working
Sajid Afaque
Sajid Afaque on 10 Apr 2019
hey walter
what should i do now,if i want to read the same image in another gui named gui2, without specifing the image name

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Products


Release

R2016b