From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to determine specific image is empty in a specific folder
Date: Thu, 18 Feb 2010 16:22:05 +0000 (UTC)
Organization: STFC Rutherford Appleton Laboratory
Lines: 51
Message-ID: <hljpfd$a28$>
References: <hljmnq$933$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1266510125 10312 (18 Feb 2010 16:22:05 GMT)
NNTP-Posting-Date: Thu, 18 Feb 2010 16:22:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 968489
Xref: comp.soft-sys.matlab:609338

"Zulkifli " <> wrote in message <hljmnq$933$>...
> Hi all,
> I try to use isempty, but i won't work. What i'm trying to do firstly to call the folder directory where images is stored using the following command
> bandpath = 'C:\System\band files';
> then i specify the image i want using the following command
> bandFiles = dir(fullfile(bandpath, 'band2.JPG'));
> Then i'm stuck. 
> what i'm trying to do next is to use if-else statement.
> where, if the 'band2.JPG' exist, the it will imshow('band2.JPG')
> else 
> warndlg('No file recorded!!!','!! Warning !!');
> break;
> end
> the problem is that, i do not know how to write a code to justify that the band2.JPG 
> exist. pls help. thanks

Something like
% Define the Path to the File
BandPath = 'C:\System\band files';

% Create the full Filename, including Directory
Filename = fullfile(bandpath, 'band2.JPG');

% Check if the file exists
    % Yes it exists
    MyImage = imread(Filename);
    % Do things .....
    % No it doesn't exist
    warndlg('No file recorded!!!','!! Warning !!');

Warning I haven't tried this, but I believe something along these lines should give you what I understand you want


Dave Robinson