MATLAB 도움말 센터
Determine if a file-set has a previous file
tf = hasPreviousFile(fs)
tf = hasPreviousFile(fs) returns logical 1 (true) if a previous file is available to process in the FileSet object specified by fs. Otherwise, it returns logical 0 (false).
fs
1
true
FileSet
0
false
example
collapse all
Check if a file-set has a previous file available to process.
Create a file-set fs for a collection of files.
folder = {'accidents.mat','airlineResults.mat','census.mat','earth.mat'}
folder = 1×4 cell {'accidents.mat'} {'airlineResults.mat'} {'census.mat'} {'earth.mat'}
fs = matlab.io.datastore.FileSet(folder)
fs = FileSet with properties: NumFiles: 4 NumFilesRead: 0 FileInfo: Show FileInfo for all 4 files AlternateFileSystemRoots: {}
Get the information for the first file and move the internal pointer forward one file.
file1 = nextfile(fs)
file1 = 1×1 FileInfo Filename FileSize _________________________________________________________________________________________________________________ ________ "/mathworks/devel/bat/filer/batfs2566-0/Bdoc25b.2988451/build/runnable/matlab/toolbox/matlab/demos/accidents.mat" 7343
Get information for the second file and move the internal pointer forward one file.
file2 = nextfile(fs)
file2 = 1×1 FileInfo Filename FileSize ______________________________________________________________________________ __________ "/tmp/Bdoc25b_2988451_1242027/tp0f1832b3/matlab-ex56196164/airlineResults.mat" 1.5042e+05
Check to see if a previous file exists. In this case, the result is true because a previous file exists.
tf = logical 1
File-set, specified as a FileSet object. To create a FileSet object, see matlab.io.datastore.FileSet.
matlab.io.datastore.FileSet
Introduced in R2020a
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
유럽
아시아 태평양
지역별 지사에 문의