The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 " <> wrote in message <gsifah$5ud$>...
> 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 at NCTM 1994-2018. All Rights Reserved.