isShuffleable - Determine whether datastore is shuffleable - MATLAB (original) (raw)
Main Content
Determine whether datastore is shuffleable
Syntax
Description
tf = isShuffleable([dst](#mw%5F6b4afc52-bb38-4cdd-b271-1b7cb804111a))
returns logical1
(true
) if the datastore dst
is shuffleable and logical 0
(false
) otherwise.
You can use the shuffle function on shuffleable datastores to randomize the ordering of files while preserving the row associations of files in different datastores.
Examples
When you have a matlab.io.datastore.SimulationDatastore
object that contains big data from a simulation, you can determine the shuffleability of the SimulationDatastore
using the isShuffleable
function.
Log Big Data from Model
Open the example model sldemo
_f
uelsys
.
mdl = "sldemo_fuelsys"; open_system(mdl)
Select Configuration Parameters > Data Import/Export > Log Dataset data to file. Alternatively, you can use the set_param
function to log simulation data logged using the Dataset
format to a MAT file instead of the workspace.
set_param(mdl,"LoggingToFile","on")
Simulate the model.
The MAT file out.mat
appears in your current folder. Logged signal data is stored in the MAT file with the variable name sldemo_fuelsys_out
.
Create a DatasetRef
object that refers to the logged signal data.
DSRef = Simulink.SimulationData.DatasetRef("out.mat","sldemo_fuelsys_output");
Preview Big Data
Use curly braces to extract the signal named fuel
, which is the tenth element in DSRef
, as a Simulink.SimulationData.Signal
object. The SimulationDatastore
object exists in the Values
property of the returned Signal
object named SimDataSig
.
SimDataSig = DSRef{10}; DStore = SimDataSig.Values;
Determine whether the datastore is shuffleable.
if isShuffleable(DStore) disp("Datastore is shuffleable.") else disp("Datatstore is not shuffleable.") end
Datatstore is not shuffleable.
Input Arguments
Input datastore. You can use these datastores as input:
- MATLAB® datastores — Datastores created using MATLABdatastore functions. For a complete list of datastores, see Select Datastore for File Format or Application.
- Combined and transformed datastores — Datastores created using the combine and transform functions.
- Custom datastores — Datastores created using the custom datastore framework. Any datastore that subclasses from
matlab.io.Datastore
supports theisShuffleable
function. See Develop Custom Datastore for more information.
Version History
Introduced in R2020a
See Also
Objects
- matlab.io.datastore.sdidatastore | matlab.io.datastore.SimulationDatastore | Simulink.sdi.DatasetRef | matlab.io.Datastore