Main Content

labeledSignalSet

Create labeled signal set

Since R2018b

Description

UselabeledSignalSetto store labeled signals along with label definitions. Create signal label definitions usingsignalLabelDefinition.

Creation

Description

lssl =abeledSignalSetcreates an empty labeled signal set. UseaddMembersto add signals to the set. UseaddLabelDefinitionsto add label definitions to the set.

example

lssl =abeledSignalSet(src)creates a labeled signal set for the input data sourcesrc. UseaddLabelDefinitionsto add label definitions to the set.

lssl =abeledSignalSet(src,lbldefs)creates a labeled signal set for the input data sourcesrcusing the signal label definitionslbldefs. UsesignalLabelDefinitionto create signal label definitions.

lssl =abeledSignalSet(src,lbldefs,'MemberNames',mnames)creates a labeled signal set for the input data sourcesrcand specifies names for the members of the set. UsesetMemberNamesto modify the member names.lbldefsis optional.

example

lssl =abeledSignalSet(src,lbldefs,Name,Value)setsPropertiesusing name-value arguments. You can specify multiple name-value arguments. Enclose each property name in quotes.lbldefsis optional.

Input Arguments

expand all

Input data source, specified as a matrix, a cell array, a timetable, asignalDatastoreobject, or anaudioDatastore(Audio Toolbox)object.srcimplicitly specifies the number of members of the set, the number of signals in each member, and the data in each signal.

Example:{randn(10,3),randn(17,9)}has two members. The first member contains three 10-sample signals. The second member contains nine 17-sample signals.

Example:{{randn(10,1)},{randn(17,1),randn(27,1)}}has two members. The first member contains one 10-sample signal. The second member contains a 17-sample signal and a 27-sample signal.

Example:{{timetable(seconds(1:10)',randn(10,3)),timetable(seconds(1:7)',randn(7,2))},{timetable(seconds(1:3)',randn(3,1))}}has two members. The first member contains three signals sampled at 1 Hz for 10 seconds and two signals sampled at 1 Hz for 7 seconds. The second member contains one signal sampled at 1 Hz for 3 seconds.

Example:signalDatastoreObject Pointing to Files

Specify the path to a set of sample sound signals included as MAT-files with MATLAB®. Each file contains a signal variable and a sample rate. List the names of the files.

folder = fullfile(matlabroot,"toolbox","matlab","audiovideo"); lst = dir(append(folder,“/ * .mat”)); nms = {lst(:).name}'
nms =7x1 cell{'chirp.mat' } {'gong.mat' } {'handel.mat' } {'laughter.mat'} {'mtlb.mat' } {'splat.mat' } {'train.mat' }

Create a signal datastore that points to the specified folder. Set the sample rate variable name toFs, which is common to all files. Generate a subset of the datastore that excludes the filemtlb.mat, which differs from the other files in that the signal variable is not calledy.

sds = signalDatastore(folder,"SampleRateVariableName","Fs"); sdss = subset(sds,~strcmp(nms,"mtlb.mat"));

Use the subset datastore as the source for alabeledSignalSetobject.

lss = labeledSignalSet(sdss)
lss = labeledSignalSet with properties: Source: [1x1 signalDatastore] NumMembers: 6 TimeInformation: "inherent" Labels: [6x0 table] Description: "" Use labelDefinitionsHierarchy to see a list of labels and sublabels. Use setLabelValue to add data to the set.

Label definitions, specified as a vector ofsignalLabelDefinitionobjects.

Member names, specified as a character vector, a string scalar, a cell array of character vectors, or a string array.

Example:labeledSignalSet({randn(100,1) randn(10,1)},'MemberNames',{'llama' 'alpaca'})specifies a set of random signals with two members,'llama'and'alpaca'.

Properties

expand all

Labeled signal set description, specified as a character vector or string scalar.

Example:'Description','Sleep test patients by sex and age'

Data Types:char|string

This property is read-only.

Sample rate values, specified as a positive scalar or a vector. This property is valid only when the data source does not contain inherent time information.

  • SetSampleRateto a positive numeric scalar to specify the same sample rate for all signals in the labeled set.

  • SetSampleRateto a vector to specify that each member of the labeled set has signals sampled at the same rate, but the sample rates differ from member to member. The vector must have a number of elements equal to the number of members of the set. If a member of a set has signals with different sample rates, then specify the sample rates using timetables.

Example:'SampleRate',[1e2 1e3]specifies that the signals in the first member of a set are sampled at a rate of 100 Hz and the signals in the second member are sampled at 1 kHz.

This property is read-only.

Sample time values, specified as a positive scalar, a vector, adurationscalar, or adurationvector. This property is valid only when the data source does not contain inherent time information.

  • SetSampleTimeto a numeric ordurationscalar to specify the same sample time for all signals in the labeled set.

  • SetSampleTimeto a numeric ordurationvector to specify that each member of the labeled set has signals with the same time interval between samples, but the intervals differ from member to member. The vector must have a number of elements equal to the number of members of the set. If a member of a set has signals with different sample times, then specify the sample times using timetables.

Example:'SampleTime',seconds([1e-2 1e-3])specifies that the signals in the first member of a set have 0.01 second between samples, and the signals in the second member have 1 millisecond between samples.

This property is read-only.

Time values, specified as a vector, adurationvector, a matrix, or a cell array. This property is valid only when the data source does not contain inherent time information. Time values must be unique and increasing.

  • SetTimeValuesto a numeric ordurationvector to specify the same time values for all signals in the labeled set. The vector must have the same length as all the signals in the set.

  • SetTimeValuesto a numeric ordurationmatrix or cell array to specify that each member of the labeled set has signals with the same time values, but the time values differ from member to member.

    • IfTimeValuesis a matrix, then it must have a number of columns equal to the number of members of the set. All signals in the set must have a length equal to the number of rows of the matrix.

    • IfTimeValues是一个单元阵列,那么它必须包含一个数字的vectors equal to the number of members of the set. All signals in a member must have a length equal to the number of elements of the corresponding vector in the cell array.

If a member of a set has signals with different time values, then specify the time values using timetables.

Example:'TimeValues',[1:1000;0:1/500:2-1/500]'specifies that the signals in the first member of a set are sampled 1 Hz for 1000 seconds. The signals in the second member are sampled at 500 Hz for 2 seconds.

Example:'TimeValues',seconds([1:1000;0:1/500:2-1/500]')specifies that the signals in the first member of a set are sampled 1 Hz for 1000 seconds. The signals in the second member are sampled at 500 Hz for 2 seconds.

Example:'TimeValues',{1:1000,0:1/500:2-1/500}specifies that the signals in the first member of a set are sampled 1 Hz for 1000 seconds. The signals in the second member are sampled at 500 Hz for 2 seconds.

Example:'TimeValues',{seconds(1:1000),seconds(0:1/500:2-1/500)}specifies that the signals in the first member of a set are sampled 1 Hz for 1000 seconds. The signals in the second member are sampled at 500 Hz for 2 seconds.

This property is read-only.

Number of members in set, specified as a positive integer.

This property is read-only.

Labels table, specified as a MATLAB®table. Each variable ofLabelscorresponds to a label defined for the set. Each row ofLabelscorresponds to a member of the data source. The row names ofLabelsare the member names.

Data Types:table

Time information of source, specified as one of the following:

  • 'none'— The signals in the source have no time information.

  • 'sampleRate'— The signals in the source are sampled at a specified rate.

  • 'sampleTime'— The signals in the source have a specified time interval between samples.

  • 'timeValues— The signals in the source have a time value corresponding to each sample.

  • 'inherent'— The signals in the source contain inherent time information. MATLAB timetables are an example of such signals.

Data Types:char|string

This property is read-only.

Data source of labeled signal set, specified as a matrix, a timetable, a cell array, or an audio datastore.

  • IfSourceis a numeric matrix, then the labeled signal set has one member that contains a number of signals equal to the number of matrix columns.

    Example:labeledSignalSet(randn(10,3))has one member that contains three 10-sample signals.

  • IfSourceis a cell array of matrices, then the labeled signal set has a number of members equal to the number of matrices in the cell array. Each member contains a number of signals equal to the number of columns of the corresponding matrix.

    Example:labeledSignalSet({randn(10,3),randn(17,9)})has two members. The first member contains three 10-sample signals. The second member contains nine 17-sample signals.

  • IfSourceis a cell array, and each element of the cell array is a cell array of numeric vectors, then the labeled signal set has a number of members equal to the number of cell array elements. Each signal within a member can have any length.

    Example:labeledSignalSet({{randn(10,1)},{randn(17,1),randn(27,1)}})has two members. The first member contains one 10-sample signal. The second member contains a 17-sample signal and a 27-sample signal.

  • IfSourceis a timetable with variables containing numeric values, then the labeled signal set has one member that contains a number of signals equal to the number of variables. The time values of the timetable must be of typeduration, unique, and increasing.

    Example:labeledSignalSet(timetable(seconds(1:10)',randn(10,3)))has one member that contains three signals sampled at 1 Hz for 10 seconds.

  • IfSourceis a cell array of timetables, and each timetable has an arbitrary number of variables with numeric values, then the labeled signal set has a number of members equal to the number of timetables. Each member contains a number of signals equal to the number of variables in the corresponding timetable.

    Example:labeledSignalSet({timetable(seconds(1:10)',randn(10,3)),timetable(seconds(1:5)',randn(5,13))})has two members. The first member contains three signals sampled at 1 Hz for 10 seconds. The second member contains 13 signals sampled at 1 Hz for 5 seconds.

  • IfSourceis a cell array, and each element of the cell array is a cell array of timetables, then the labeled signal set has a number of members equal to the number of cell array elements. Each member can have any number of timetables, and each timetable within a member can have any number of variables.

    Example:labeledSignalSet({{timetable(seconds(1:10)',randn(10,3)),timetable(seconds(1:7)',randn(7,2))},{timetable(seconds(1:3)',randn(3,1))}})has two members. The first member contains three signals sampled at 1 Hz for 10 seconds and two signals sampled at 1 Hz for 7 seconds. The second member contains one signal sampled at 1 Hz for 3 seconds.

  • If the input data source,src, is an audio datastore, then the labeled signal set has a number of members equal to the number of files to which the datastore points. TheSource属性包含一个单元阵列的特征向量s with the file names. Each member contains all the signals returned by the read of the corresponding datastore file.

Object Functions

addLabelDefinitions Add label definitions to labeled signal set
addMembers Add members to labeled signal set
countLabelValues Count label values
createDatastores Create datastores pointing to signal and label data
createFeatureData Create feature table or matrix and response vectors
editLabelDefinition Edit label definition properties
getAlternateFileSystemRoots Get alternate file system roots when data source of labeled signal set is a datastore
getLabelDefinitions Get label definitions in labeled signal set
getLabeledSignal Get labeled signals from labeled signal set
getLabelIndices Get label indices pointing to label definitions in labeled signal set
getLabelNames Get label names in labeled signal set
getLabelValues Get label values from labeled signal set
getMemberNames Get member names in labeled signal set
getSignal Get signals from labeled signal set
head Get top rows of labels table
labelDefinitionsHierarchy Get hierarchical list of label and sublabel names
labelDefinitionsSummary Get summary table of signal label definitions
merge Merge two or more labeled signal sets
removeLabelDefinition Remove label definition from labeled signal set
removeMembers Remove members from labeled signal set
removePointValue Remove row from point label
removeRegionValue Remove row from ROI label
resetLabelValues Reset labels to default values
setAlternateFileSystemRoots Set alternate file system roots when data source of labeled signal set is a datastore
setLabelValue Set label value in labeled signal set
setMemberNames Set member names in labeled signal set
subset Get new labeled signal set with subset of members

Examples

collapse all

Consider a set of whale sound recordings. The recorded whale sounds consist of trills and moans.Trillssound like series of clicks.Moansare low-frequency cries similar to the sound made by a ship's horn. You want to look at each signal and label it to identify the whale type, the trill regions, and the moan regions. For each trill region, you also want to label the signal peaks higher than a certain threshold.

Signal Label Definitions

Define an attribute label to store whale types. The possible categories are blue whale, humpback whale, and white whale.

dWhaleType = signalLabelDefinition('WhaleType',...'LabelType','attribute',...'LabelDataType','categorical',...'Categories',{'blue','humpback','white'},...'Description','Whale type');

Define a region-of-interest (ROI) label to capture moan regions. Define another ROI label to capture trill regions.

dMoans = signalLabelDefinition('MoanRegions',...'LabelType','roi',...'LabelDataType','logical',...'Description','Regions where moans occur'); dTrills = signalLabelDefinition('TrillRegions',...'LabelType','roi',...'LabelDataType','logical',...'Description','Regions where trills occur');

Finally, define a point label to capture the trill peaks. Set this label as a sublabel of thedTrillsdefinition.

dTrillPeaks = signalLabelDefinition('TrillPeaks',...'LabelType','point',...'LabelDataType','numeric',...'Description','Trill peaks'); dTrills.Sublabels = dTrillPeaks;

Labeled Signal Set

Create alabeledSignalSetwith the whale signals and the label definitions. Add label values to identify the whale type, the moan and trill regions, and the peaks of the trills.

loadlabelwhalesignalslbldefs = [dWhaleType dMoans dTrills]; lss = labeledSignalSet({whale1 whale2},lbldefs,'MemberNames',{'Whale1','Whale2'},...'SampleRate',Fs,'Description','Characterize whale song regions');

Visualize the label hierarchy and label properties usinglabelDefinitionsHierarchyandlabelDefinitionsSummary.

labelDefinitionsHierarchy(lss)
ans = 'WhaleType Sublabels: [] MoanRegions Sublabels: [] TrillRegions Sublabels: TrillPeaks '
labelDefinitionsSummary (lss)
ans=3×9 tableLabelName LabelType LabelDataType类别有效ationFunction DefaultValue Sublabels Tag Description ______________ ___________ _____________ ____________ __________________ ____________ ___________________________ ___ ____________________________ "WhaleType" "attribute" "categorical" {3x1 string} {["N/A" ]} {0x0 double} {0x0 double } "" "Whale type" "MoanRegions" "roi" "logical" {["N/A" ]} {0x0 double} {0x0 double} {0x0 double } "" "Regions where moans occur" "TrillRegions" "roi" "logical" {["N/A" ]} {0x0 double} {0x0 double} {1x1 signalLabelDefinition} "" "Regions where trills occur"

The signals in the loaded data correspond to songs of two blue whales. Set the'WhaleType'values for both signals.

setLabelValue(lss,1,'WhaleType','blue'); setLabelValue(lss,2,'WhaleType','blue');

Visualize the'Labels'property. The table has the newly added'WhaleType'values for both signals.

lss.Labels
ans=2×3 tableWhaleType MoanRegions TrillRegions _________ ___________ ____________ Whale1 blue {0x2 table} {0x3 table} Whale2 blue {0x2 table} {0x3 table}

Visualize Region Labels

Visualize the whale songs to identify the trill and moan regions.

subplot(2,1,1) plot((0:length(whale1)-1)/Fs,whale1) ylabel('Whale 1') subplot(2,1,2) plot((0:length(whale2)-1)/Fs,whale2) ylabel('Whale 2')

Figure contains 2 axes objects. Axes object 1 with ylabel Whale 1 contains an object of type line. Axes object 2 with ylabel Whale 2 contains an object of type line.

Moan regions are sustained low-frequency wails.

  • whale1has moans centered at about 7 seconds, 12 seconds, and 17 seconds.

  • whale2has moans centered at about 3 seconds, 7 seconds, and 16 seconds.

Add the moan regions to the labeled set. Specify the ROI limits in seconds and the label values.

恐鸟nRegionsWhale1 = [6.1 7.7; 11.4 13.1; 16.5 18.1]; mrsz1 = [size(moanRegionsWhale1,1) 1]; setLabelValue(lss,1,'MoanRegions'、moanRegionsWhale1真实(mrsz1));恐鸟nRegionsWhale2 = [2.5 3.5; 5.8 8; 15.4 16.7]; mrsz2 = [size(moanRegionsWhale2,1) 1]; setLabelValue(lss,2,'MoanRegions',moanRegionsWhale2,true(mrsz2));

Trill regions have distinct bursts of sound punctuated by silence.

  • whale1has a trill centered at about 2 seconds.

  • whale2has a trill centered at about 12 seconds.

Add the trill regions to the labeled set.

trillRegionWhale1 = [1.4 3.1]; trsz1 = [size(trillRegionWhale1,1) 1]; setLabelValue(lss,1,'TrillRegions',trillRegionWhale1,true(trsz1)); trillRegionWhale2 = [11.1 13]; trsz2 = [size(trillRegionWhale1,1) 1]; setLabelValue(lss,2,'TrillRegions',trillRegionWhale2,true(trsz2));

Create asignalMaskobject for each whale song and use it to visualize and label the different regions. For better visualization, change the label values from logical to categorical.

mr1 = getLabelValues(lss,1,'MoanRegions'); mr1.Value = categorical(repmat("moan",mrsz1)); tr1 = getLabelValues(lss,1,'TrillRegions'); tr1.Value = categorical(repmat("trill",trsz1)); msk1 = signalMask([mr1;tr1],'SampleRate',Fs); subplot(2,1,1) plotsigroi(msk1,whale1) ylabel('Whale 1') holdonmr2 = getLabelValues(lss,2,'MoanRegions'); mr2.Value = categorical(repmat("moan",mrsz2)); tr2 = getLabelValues(lss,2,'TrillRegions'); tr2.Value = categorical(repmat("trill",trsz2)); msk2 = signalMask([mr2;tr2],'SampleRate',Fs); subplot(2,1,2) plotsigroi(msk2,whale2) ylabel('Whale 2') holdon

Figure contains 2 axes objects. Axes object 1 with xlabel Seconds, ylabel Whale 1 contains 3 objects of type line. Axes object 2 with xlabel Seconds, ylabel Whale 2 contains 3 objects of type line.

Visualize Point Labels

Label three peaks for each trill region. For point labels, you specify the point locations and the label values. In this example, the point locations are in seconds.

peakLocsWhale1 = [1.553 1.626 1.7]; peakValsWhale1 = [0.211 0.254 0.211]; setLabelValue(lss,1,{'TrillRegions','TrillPeaks'},...peakLocsWhale1,peakValsWhale1,'LabelRowIndex',1); subplot(2,1,1) plot(peakLocsWhale1,peakValsWhale1,'v') holdoffpeakLocsWhale2 = (11.214 11.288 11.437);peakValsWhale2 = [0.119 0.14 0.15]; setLabelValue(lss,2,{'TrillRegions','TrillPeaks'},...peakLocsWhale2,peakValsWhale2,'LabelRowIndex',1); subplot(2,1,2) plot(peakLocsWhale2,peakValsWhale2,'v') holdoff

Figure contains 2 axes objects. Axes object 1 with xlabel Seconds, ylabel Whale 1 contains 4 objects of type line. One or more of the lines displays its values using only markers Axes object 2 with xlabel Seconds, ylabel Whale 2 contains 4 objects of type line. One or more of the lines displays its values using only markers

Explore Label Values

Explore the label values usinggetLabelValues.

getLabelValues(lss)
ans=2×3 tableWhaleType MoanRegions TrillRegions _________ ___________ ____________ Whale1 blue {3x2 table} {1x3 table} Whale2 blue {3x2 table} {1x3 table}

Retrieve the moan regions for the first member of the labeled set.

getLabelValues(lss,1,'MoanRegions')
ans=3×2 tableROILimits Value ____________ _____ 6.1 7.7 {[1]} 11.4 13.1 {[1]} 16.5 18.1 {[1]}

Use a second output argument to list the sublabels of a label.

[value,valueWithSublabel] = getLabelValues(lss,1,'TrillRegions')
value=1×2 tableROILimits Value __________ _____ 1.4 3.1 {[1]}
valueWithSublabel=1×3 tableROILimits Value Sublabels TrillPeaks __________ _____ ___________ 1.4 3.1 {[1]} {3x2 table}

To retrieve the values in a sublabel, express the label name as a two-element array.

getLabelValues(lss,1,{'TrillRegions','TrillPeaks'})
ans=3×2 tableLocation Value ________ __________ 1.553 {[0.2110]} 1.626 {[0.2540]} 1.7 {[0.2110]}

Find the value of the third trill peak corresponding to the second member of the set.

getLabelValues(lss,2,{'TrillRegions','TrillPeaks'},...'LabelRowIndex',1,'SublabelRowIndex',3)
ans=1×2 tableLocation Value ________ __________ 11.437 {[0.1500]}

Specify the path to a set of audio signals included as MAT-files with MATLAB®. Each file contains a signal variable and a sample rate. List the names of the files.

folder = fullfile(matlabroot,"toolbox","matlab","audiovideo"); lst = dir(append(folder,“/ * .mat”)); nms = {lst(:).name}'
nms =7x1 cell{'chirp.mat' } {'gong.mat' } {'handel.mat' } {'laughter.mat'} {'mtlb.mat' } {'splat.mat' } {'train.mat' }

Create a signal datastore that points to the specified folder. Set the sample rate variable name toFs, which is common to all files. Generate a subset of the datastore that excludes the filemtlb.mat. Use the subset datastore as the source for alabeledSignalSetobject.

sds = signalDatastore(folder,"SampleRateVariableName","Fs"); sds = subset(sds,~strcmp(nms,"mtlb.mat")); lss = labeledSignalSet(sds);

Create three label definitions to label the signals:

  • Define a logical attribute label that is true for signals that contain human voices.

  • Define a numeric point label that marks the location and amplitude of the maximum of each signal.

  • Define a categorical region-of-interest (ROI) label to pick out nonoverlapping, uniform-length random regions of each signal.

Add the signal label definitions to the labeled signal set.

vc = signalLabelDefinition("Voice",'LabelType','attribute',...'LabelDataType','logical','DefaultValue',false); mx = signalLabelDefinition("Maximum",'LabelType','point',...'LabelDataType','numeric'); rs = signalLabelDefinition("RanROI",'LabelType','ROI',...'LabelDataType','categorical','Categories',["ROI""other"]); addLabelDefinitions(lss,[vc mx rs])

Label the signals:

  • Label'handel.mat'and'laughter.mat'as having human voices.

  • Use theislocalmaxfunction to find the maximum of each signal. Label its location and value.

  • Use therandROIfunction to generate as many regions of lengthN/10 samples as can fit in a signal of lengthNgiven a minimum separation ofN/6 samples between regions. Label their locations and assign them to theROIcategory.

When labeling points and regions, convert sample values to time values. Subtract 1 to account for MATLAB® array indexing and divide by the sample rate.

kj = 1;whilehasdata(sds) [sig,info] = read(sds); fs = info.SampleRate; [~,fn] = fileparts(info.FileName);iffn=="handel"|| fn=="laughter"setLabelValue(lss,kj,"Voice",true)endxm = find(islocalmax(sig,'MaxNumExtrema',1)); setLabelValue(lss,kj,"Maximum",(xm-1)/fs,sig(xm)) N = length(sig); rois = randROI(N,round(N/10),round(N/6)); setLabelValue(lss,kj,"RanROI",(rois-1)/fs,repelem("ROI",size(rois,1))) kj = kj+1;end

Verify that only two signals contain voices.

countLabelValues(lss,"Voice")
ans=2×3 tableVoice Count Percent _____ _____ _______ false 4 66.667 true 2 33.333

Verify that two signals have a maximum amplitude of 1.

countLabelValues(lss,"Maximum")
ans=5×4 tableMaximum Count Percent MemberCount ______________________ _____ _______ ___________ 0.80000000000000004441 1 16.667 1 0.89113331915798421612 1 16.667 1 0.94730769230769229505 1 16.667 1 1 2 33.333 2 1.0575668990330560071 1 16.667 1

Verify that each signal has four nonoverlapping random regions of interest.

countLabelValues(lss,"RanROI")
ans=2×4 tableRanROI Count Percent MemberCount ______ _____ _______ ___________ ROI 24 100 6 other 0 0 0

Create two datastores with the data in the labeled signal set:

  • ThesignalDatastoreobjectsdcontains the signal data.

  • ThearrayDatastoreobjectldcontains the labeling information. Specify that you want to include the information corresponding to all the labels you created.

[sd,ld] = createDatastores(lss,["Voice""RanROI""Maximum"]);

Use the information in the datastores to plot the signals and display their labels.

  • Use asignalMaskobject to highlight the regions of interest in blue.

  • Plot yellow lines to mark the locations of the maxima.

  • Add a red axis label to the signals that contain human voices.

tiledlayoutflowwhilehasdata(sd) [sg,nf] = read(sd); lbls = read(ld); nexttile msk = signalMask(lbls{:}.RanROI{:},'SampleRate',nf.SampleRate); plotsigroi(msk,sg) colorbaroffxlabel('') xline(lbls{:}.Maximum{:}.Location,...'LineWidth',2,'Color','#EDB120')iflbls{:}.Voice{:} ylabel('VOICED','Color','#D95319')endend

Figure contains 6 axes objects. Axes object 1 contains 4 objects of type line, constantline. Axes object 2 contains 4 objects of type line, constantline. Axes object 3 with ylabel VOICED contains 4 objects of type line, constantline. Axes object 4 with ylabel VOICED contains 4 objects of type line, constantline. Axes object 5 contains 4 objects of type line, constantline. Axes object 6 contains 4 objects of type line, constantline.

functionroilims = randROI(N,wid,sep) num = floor((N+sep)/(wid+sep)); hq = histcounts(randi(num+1,1,N-num*wid-(num-1)*sep),(1:num+2)-1/2); roilims = (1 + (0:num-1)*(wid+sep) + cumsum(hq(1:num)))' + [0 wid-1];end

Version History

Introduced in R2018b