assigning images to appdata and checking if exists
이전 댓글 표시
After saving an image IM into appdata using
img=setappdata(0,IM,'pic')
I want to be able to check if this field 'pic' exists later. The reason is that I haver radio buttons that autoscale an image and I only want them to perform the autoscale routine if the image has been saved into memory using appdata.
Later when I retrieve the image by:
img=getappdata(0,'pic')
If the image isn't there,then I don't want the autoscale routine to continue (as it has nothing to autoscale and crashes)
I have tried:
isfield(0,'pic')
but this didn't work.
Is there another way to check whether the IM has already been assigned the 'pic'
Thanks Jason
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!