Main Content

getAlternateFileSystemRoots

Get alternate file system roots when data source of labeled signal set is a datastore

Since R2022a

Description

altroots = getAlternateFileSystemRoots(lss) returns the current alternate file system roots set in the underlying datastore source of the labeled signal set lss. The function applies only to labeled signal sets whose data source is a datastore that points to files.

example

Examples

collapse all

Create a labeledSignalSet to store labels for electromyographic (EMG) signals and get alternate file paths for the underlying data source which you can use to access the signals on a different machine. Download the files from this location: https://ssd.mathworks.com/supportfiles/SPT/data/MyoelectricData.zip.

Use a signalDatastore to consume the signal files from the EMG data set. Modify folder to correspond to the location where you download the files. The data set is organized into subfolders, so enable the IncludeSubfolders flag.

folder = "C:\path\Data";
sds = signalDatastore(folder,IncludeSubfolders=true);

Create a labeledSignalSet object with the datastore as the input data source. To access the source data of the underlying datastore on different machines and operating systems, use setAlternateFileSystemRoots to set alternate file paths to the data. Replace folder2 with your desired root path(s). You can also set alternate file system roots for the datastore before creating the labeled signal set.

lss = labeledSignalSet(sds);
folder2 = "E:\path2\Data";
setAlternateFileSystemRoots(lss,[folder folder2]);

Get the current alternate file system roots in the underlying datastore of the labeled signal set to confirm that all the file paths are included.

altroots = getAlternateFileSystemRoots(lss);

Input Arguments

collapse all

Labeled signal set, specified as a labeledSignalSet object. The function applies only to labeled signal sets whose data source is a datastore that points to files.

Output Arguments

collapse all

Alternate file system roots, returned as a string array.

Version History

Introduced in R2022a