automate calculate total of images saved in a folder

2 次查看(过去 30 天)
i don't know how to type for the codings to automatic calculate the total of images saved as '.spm' in a folder and show the number of total on the designed interface using GUIDE.
  2 个评论
Melindalee
Melindalee 2015-7-10
My question is about automatic calculate the total of images in a folder, i used the coding provided by Mr./Mrs/Miss Image Analyst and it works. Now i faced another problem is that i will have new folder for everyday, so how can i make it to automatic calculate the total of images in the folder everyday.

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2015-7-10
Try something like this:
filePattern = fullfile(yourFolder, '*.spm');
files = dir(filePattern);
numberOfFiles = length(files);
message = sprintf('Total number of spm files = %d', numberOfFiles);
set(handles.text1, 'String', message);
  8 个评论
Melindalee
Melindalee 2015-7-22
编辑:Melindalee 2015-7-22
yea i do my searching on datenum, currently i just able to get the date and time of computer and play with deduction or subtraction of day, i still havent figure out how to get the modified date of files..
datenow = datestr(clock,0);
dateNowNum = datenum(datenow);
date12hrsBe4r = datestr(dateNowNum-0.50);
this just for finding current time and the time of 12 hours ago..i wanted to make it as a range and calculate how many files which their date and time are within this range, but i still have no idea on how to write the codings, do you still have any suggestion?
Melindalee
Melindalee 2015-8-5
编辑:Melindalee 2015-8-5
I'd found the solution, anyway thank you very much =D

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by