hasPreviousBlock
Description
Examples
Check If Blocked File-Set Has Previous Block
Check if a blocked file-set has a previous block available to process.
Create a blocked file-set bs
for a collection of files.
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: Show BlockInfo for all 4 blocks AlternateFileSystemRoots: {}
Get the information for the first block and move the internal pointer forward one block.
blk1 = nextblock(bs)
blk1 = 1x1 BlockInfo Filename FileSize Offset BlockSize ______________________________________________________________________________ ________ ______ _________ "/mathworks/devel/bat/Bdoc23a/build/matlab/toolbox/matlab/demos/accidents.mat" 7343 0 7343
Get information for the second block and move the internal pointer forward one block.
blk2 = nextblock(bs)
blk2 = 1x1 BlockInfo Filename FileSize Offset BlockSize ___________________________________________________________________________________ __________ ______ __________ "/mathworks/devel/bat/Bdoc23a/build/matlab/toolbox/matlab/demos/airlineResults.mat" 1.5042e+05 0 1.5042e+05
Check to see if a previous block exists. In this case, the result is true
because a previous block exists.
tf = hasPreviousBlock(bs)
tf = logical
1
Input Arguments
bs
— Blocked file-set
matlab.io.datastore.BlockedFileSet
object
Blocked file-set, specified as a matlab.io.datastore.BlockedFileSet
object. To create a BlockedFileSet
object, see matlab.io.datastore.BlockedFileSet
.
Example: hasPreviousBlock(bs)
Version History
Introduced in R2020a
Beispiel öffnen
Sie haben eine geänderte Version dieses Beispiels. Möchten Sie dieses Beispiel mit Ihren Änderungen öffnen?
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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)