Main Content

isPartitionable

Determine whether datastore is partitionable

Since R2020a

Description

tf = isPartitionable(dst) returns logical 1 (true) if the datastore dst is partitionable and logical 0 (false) otherwise.

example

Examples

collapse all

When you have a matlab.io.datastore.SimulationDatastore object that contains big data from a simulation, you can determine the partitionability of the SimulationDatastore using the isPartitionable function.

Log Big Data from Model

Open the example model sldemo_fuelsys.

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.

sim(mdl)

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 partitionable.

if isPartitionable(DStore)
    disp("Datastore is partitionable.")
else
    disp("Datatstore is not partitionable.")
end
Datatstore is not partitionable.

Input Arguments

collapse all

Input datastore. You can use these types of datastores as input:

  • MATLAB® datastores — Datastores created using MATLAB datastore 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 the isPartitionable function. See Develop Custom Datastore for more information.

Version History

Introduced in R2020a