Hi Candy Lau,
The error message indicates that MATLAB cannot find the `preprocessMiniBatch` function, which is used as input to the `MiniBatchFcn` argument of the `minibatchqueue` function. This error can occur if the function is not defined in the current workspace or on the MATLAB path.
To resolve this error, one of the possible workaround can be to define the `preprocessMiniBatch` function in a separate file or script in the same folder or on the MATLAB path.
Once you have defined the `preprocessMiniBatch` function, save it to a separate file or script, and make sure that the file is on the MATLAB path. Then, modify the `mbq` initialization code in your script to the following:
mbq = minibatchqueue(augimds, ...
'MiniBatchSize', miniBatchSize, ...
'PartialMiniBatch', 'discard', ...
'MiniBatchFcn', @preprocessMiniBatch, ...
'MiniBatchFormat', 'SSCB');
This should properly initialize the `mbq` object with your custom `preprocessMiniBatch` function and resolve the error you are seeing.