Main Content

isPartitionable

Class: matlab.io.datastore.SimulationDatastore
Package: matlab.io.datastore

Determine whether datastore is partitionable

Description

example

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 matlab.io.Datastore supports the isPartitionable function. See Develop Custom Datastore for more information.

Examples

expand all

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

Log Big Data from Model

Open the example model sldemo_fuelsys.

open_system('sldemo_fuelsys')

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

set_param('sldemo_fuelsys','LoggingToFile','on')

Simulate the model.

sim('sldemo_fuelsys')

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.')
else
    disp('Datatstore is not partitionable.')
end
Datatstore is not partitionable.
Introduced in R2020a