hasNextBlock
説明
例
ブロック ファイルセットに別のブロックがあるかどうかを確認する
ブロック ファイルセットに、処理できる別のブロックがあるかどうかを確認し、データを繰り返し読み取ります。
ファイルの集合のブロック ファイルセット bs
を作成します。
folder = {'accidents.mat','airlineResults.mat','census.mat','earth.mat'}
folder = 1x4 cell
{'accidents.mat'} {'airlineResults.mat'} {'census.mat'} {'earth.mat'}
bs = matlab.io.datastore.BlockedFileSet(folder)
bs = BlockedFileSet with properties: NumBlocks: 4 NumBlocksRead: 0 BlockSize: 'file' BlockInfo: BlockInfo for all 4 blocks AlternateFileSystemRoots: {}
関数 hasNextBlock
および関数 nextblock
を使用して、ブロックがセット内に残っている間に、一度に 1 つのブロック情報を読み取ります。
while hasNextBlock(bs) file = nextblock(bs) end
file = 1x1 BlockInfo Filename FileSize Offset BlockSize ________________________________________________________________________________________________________ ________ ______ _________ "/mathworks/devel/bat/filer/batfs1904-0/Bdoc24a.2511836/build/matlab/toolbox/matlab/demos/accidents.mat" 7343 0 7343
file = 1x1 BlockInfo Filename FileSize Offset BlockSize ______________________________________________________________________________ __________ ______ __________ "/tmp/Bdoc24a_2511836_3260591/tp6dd4bbae/matlab-ex12893120/airlineResults.mat" 1.5042e+05 0 1.5042e+05
file = 1x1 BlockInfo Filename FileSize Offset BlockSize _____________________________________________________________________________________________________ ________ ______ _________ "/mathworks/devel/bat/filer/batfs1904-0/Bdoc24a.2511836/build/matlab/toolbox/matlab/demos/census.mat" 353 0 353
file = 1x1 BlockInfo Filename FileSize Offset BlockSize ____________________________________________________________________________________________________ ________ ______ _________ "/mathworks/devel/bat/filer/batfs1904-0/Bdoc24a.2511836/build/matlab/toolbox/matlab/demos/earth.mat" 32522 0 32522
入力引数
bs
— ブロック ファイルセット
matlab.io.datastore.BlockedFileSet
オブジェクト
ブロック ファイルセット。matlab.io.datastore.BlockedFileSet
オブジェクトとして指定します。BlockedFileSet
オブジェクトを作成する場合は、matlab.io.datastore.BlockedFileSet
を参照してください。
例: hasNextBlock(bs)
バージョン履歴
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)