Main Content

transform

Transform datastore

Since R2025a

Description

dsnew = transform(ds1,ds2,...,dsN,@fcn) transforms one or more input datastores using the transformation function fcn and returns the transformed datastore dsnew. fcn can be placed before or after all of the input datastores in the call to the transform function.

dsnew = transform(ds1,ds2,...,dsN,@fcn,'IncludeInfo',IncludeInfo) uses an alternative definition of the transform function fcn. The alternative definition enables you to use the additional information returned by the read function of the datastore.

Input Arguments

collapse all

Input datastores, specified as simulink.multisim.MultisimDatastore objects.

Function that transforms the data, specified as a function handle. The function takes data as an input and returns the transformed data, based on the transformations defined in fcn.

The transform function must have this signature and ds1_data,ds2_data,...dsN_data must be of the same form as the data that is returned by using the read function.

function dataOut = transformFcn(ds1_data,ds2_data,...dsN_data)
..
end

Alternatively, you can define your transform function fcn to use additional information about the data returned by the read function. To use this alternative definition, you must specify the value of IncludeInfo to be true. In this case, the transformation function must have this signature.

function [dataOut,infoOut] = transformFcn(ds1_data,ds2_data,...dsN_data,ds1_info,ds2_info...dsN_info)
..
end

Example: @transformFcn

Data Types: function_handle

Include information from read function, specified as either true or false. The read function returns information about the extracted data in an info struct. For more information, see the read function page.

When you set the value of IncludeInfo to true, you must use the alternative signature for your transform function fcn.

Output Arguments

collapse all

New datastore with transformed data, returned as a TransformedDatastore object.

Version History

Introduced in R2025a