Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to open a folder and count the number of images at inside?
Replies: 7   Last Post: Apr 18, 2012 10:16 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 63
Registered: 8/9/08
Re: How to open a folder and count the number of images at inside?
Posted: Apr 20, 2009 3:02 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Blaine " <EvilDonut0@gmail.com> wrote in message <gsifah$5ud$1@fred.mathworks.com>...
> If they are all the same kind of image,
> cd('directory')
> d = dir
> eliminate entries '.' and '..', as well as other directories (i always do this as a habbit when looking for files but it is redundant in this case)
> then,
> remove = [];
> for i = 1:length(d)
> found = 0;
> searchString = "file extension";
> found = strcmp(d(i),searchString);
> if found ==0
> remove = [remove i];
> end
> end
> d(remove) = [];
> the remaining entries in d are the images you want
> Blaine

i will try it..any question dunno will come bak to ask..thx lots..

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.