필터 지우기
필터 지우기

automate calculate total of images saved in a folder

조회 수: 2 (최근 30일)
Melindalee
Melindalee 2015년 7월 10일
편집: Melindalee 2015년 8월 5일
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
Azzi Abdelmalek
Azzi Abdelmalek 2015년 7월 10일
What is your question?
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