Main Content



Determine whether datastore is partitionable



tf = isPartitionable(ds) returns logical 1 (true) if the datastore ds is partitionable. Otherwise, the result is logical 0 (false).

Input Arguments

expand all

Input datastore. You can use these 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 supports the isPartitionable function. See Develop Custom Datastore for more information.


expand all

This example shows how to determine the partitionability of a object that contains big data from a simulation.

Log Big Data from Model

Open the example model sldemo_fuelsys.


Select Configuration Parameters > Data Import/Export > Log Dataset data to file.


Simulate the model.


The MAT-file out.mat appears in your current folder. The file contains data for logged signals such as fuel (which is at the root level of the model).

At the command prompt, create a DatasetRef object that refers to the logging variable by name, sldemo_fuelsys_output.

DSRef = Simulink.SimulationData.DatasetRef('out.mat','sldemo_fuelsys_output');

Preview Big Data

Use curly braces ({ and }) to extract the signal element fuel, which is the tenth element in DSRef, as a Simulink.SimulationData.Signal object that contains a SimulationDatastore object.

SimDataSig = DSRef{10};

To more easily interact with the SimulationDatastore object that resides in the Values property of the Signal object, store a handle in a variable named DStore.

DStore = SimDataSig.Values;

Determine if the datastore is partitionable.

if isPartitionable(DStore)
    disp('Datastore is partitionable.')
    disp('Datatstore is not partitionable.')
Datatstore is not partitionable.

Version History

Introduced in R2020a