progress
说明
示例
文件读取百分比
确定已从文件集中读取的文件的百分比。
为一组文件创建一个文件集 fs
。
folder = {'accidents.mat','airlineResults.mat','census.mat','earth.mat'}
folder = 1x4 cell
{'accidents.mat'} {'airlineResults.mat'} {'census.mat'} {'earth.mat'}
fs = matlab.io.datastore.FileSet(folder)
fs = FileSet with properties: NumFiles: 4 NumFilesRead: 0 FileInfo: FileInfo for all 4 files AlternateFileSystemRoots: {}
获取第一个文件的信息,并将内部指针向前移动一个文件。
file1 = nextfile(fs)
file1 = 1x1 FileInfo Filename FileSize ________________________________________________________________________________________________________ ________ "/mathworks/devel/bat/filer/batfs1904-0/Bdoc24a.2528353/build/matlab/toolbox/matlab/demos/accidents.mat" 7343
使用 progress
函数查看已从文件集中读取的文件的百分比。
p = progress(fs)
p = 0.2500
输入参数
fs
— 文件集
BlockedFileSet
或 FileSet
对象
文件集,指定为 BlockedFileSet
或 FileSet
对象。要创建 BlockedFileSet
或 FileSet
对象,请参阅 matlab.io.datastore.BlockedFileSet
和 matlab.io.datastore.FileSet
。
版本历史记录
在 R2020a 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)