Hello Shen Zhao,
This is a known limitation in the FileDatastore + combine workflow.
Even though FileDatastore by itself is partitionable, combining two FileDatastores is currently not defined as partitionable. We are working on ways to remove this limitation in future releases.
One possible workaround for this is to directly import each pair of MAT files in a single FileDatastore. You would need to have some kind of mapping between the filenames used in the Train_Noisy/ and Train_Noise/ datasets for this to work:
addpath('Train_Noisy')
addpath('Train_Noise')
Train_Data = fileDatastore(fullfile('Train_Noisy'), 'ReadFcn', @Load_All, 'FileExtensions', '.mat');
function Data = Load_All(noisy_filename)
File = load(noisy_filename);
Noisy = File.Noisy;
noise_filename = Make_Noise_Filename(noisy_filename);
File = load(noise_filename);
Noise = File.Noise;
Data = [Noisy Noise];
end
You'd also need to define another function here called Make_Noise_Filename that converts filenames from the first dataset to the second dataset. This sidesteps the limitation in FileDatastore + combine for now.
I hope this helps!
Rylan
Best Answer