subset
Create datastore with subset of signals
Description
Examples
Specify a folder that contains signals included with Signal Processing Toolbox™. The signals are stored in .csv, .dat, and .mat files.
folder = "healthdata";Create a signal datastore that points to the specified folder. List the names of all files in the datastore.
sds = signalDatastore(folder); [~,c] = fileparts(sds.Files)
c = 10×1 cell
{'BufferedHumanActivitySignal' }
{'ECG60HzSignal' }
{'ECGSignals' }
{'ECGmit200Signal' }
{'ECGmit203Signal' }
{'EMGSignalIndices' }
{'EMGSignals' }
{'HeartRateSignals' }
{'NoisyECGSignal' }
{'WestAfricanEbolaOutbreak2014Signal'}
Create a logical vector indicating whether the file names in the signal datastore start with 'ECG'.
fileContainsAir = cellfun(@(c)startsWith(c,"ECG"),c);Call the subset function on the signal datastore and the indices corresponding to the files starting with 'ECG'.
sdssubset = subset(sds,fileContainsAir)
sdssubset =
signalDatastore with properties:
Files:{
' .../tp9a3e040b/signal-ex51213773/healthdata/ECG60HzSignal.mat';
' .../tp9a3e040b/signal-ex51213773/healthdata/ECGSignals.mat';
' .../tp9a3e040b/signal-ex51213773/healthdata/ECGmit200Signal.mat'
... and 1 more
}
Folders: {'/tmp/Bdoc26a_3233028_1936201/tp9a3e040b/signal-ex51213773/healthdata'}
AlternateFileSystemRoots: [0×0 string]
ReadSize: 1
OutputDataType: "same"
OutputEnvironment: "cpu"
Input Arguments
Signal datastore, specified as a signalDatastore object.
Specify indices as:
A vector containing the indices of files or members to be included in
sdssubset. Thesubsetfunction accepts nonunique indices.A logical vector the same length as the number of files or members in
sds. If indices are specified as a logical vector,trueindicates that the corresponding files or members are to be included insdssubset.
Data Types: double | logical
Output Arguments
Subset of signal datastore, returned as a signalDatastore object.
Version History
Introduced in R2020a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)