Waveform Segmentation Using Deep Learning: Error on getmask

We are implementing it as described in [Waveform Segmentation Using Deep Learning].


I get an error in the following process and cannot proceed.

type getmask.m
trainDs = transform(trainDs, @getmask);
testDs = transform(testDs, @getmask);

The error statement is as follows

Error: nargin

The function getmask does not exist.

Error: matlab.io.datastore.(148)

tFuncArgs = nargin(fun);

Error:matlab.io.datastore.internal.buildTransformedDatastore(line 65)

tds =


fcn, …

Error: matlab.io.Datastore/transform (line 359)

dsnew =


Error: segmentation_default (line 30)

trainDs = transform(trainDs, @getmask);


Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

You need to create it from the code they gave you on the page:

function outputCell = getmask(inputCell)
%GETMASK Convert region labels to a mask of labels of size equal to the
%size of the input ECG signal.
% inputCell is a two-element cell array containing an ECG signal vector
% and a table of region labels.
% outputCell is a two-element cell array containing the ECG signal vector
% and a categorical label vector mask of the same length as the signal.
% Copyright 2020 The MathWorks, Inc.sig = inputCell{1};
roiTable = inputCell{2};
L = length(sig);
M = signalMask(roiTable);
% Get categorical mask and give priority to QRS regions when there is overlap
mask = catmask(M,L,'OverlapAction','prioritizeByList','PriorityList',[2 1 3]);
% Set missing values to "n/a"
mask(ismissing(mask)) = "n/a";
outputCell = {sig,mask};


Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.