Why can't this example of "Signal Source Separation Using W-Net Architecture" be opened in MATLAB?

17 次查看(过去 30 天)
When I try to run the example of "Signal Source Separation Using W-Net Architecture" on MATLAB, it showed an error:
"Error saving to local data stream." when communicating with websave (line 107) 5URL 'https://ssd.mathworks.com/supportfiles/SPT/data/fetal-ecg-source-separation-testData,zip'.
error matlab,internal.examples.downloadsupportFile(line 48)localfile =websave(localfile,webFilePath);".
The code block :"Download the train and test data sets using the downloadSupportFile function. The data will be unzipped to the tempdir directory. If you want the data at a different location, change trainingDatasetFolder and testDatasetFolder to the desired locations " can't run, and the detailed code is
if trainNetworkFlag
% Download training data set
trainingDatasetZipFile = matlab.internal.examples.downloadSupportFile('SPT','data/fetal-ecg-source-separation-trainingData.zip');
trainingDatasetFolder = fullfile(tempdir,'fetal-ecg-source-separation-trainingData');
if ~exist(trainingDatasetFolder,'dir')
unzip(trainingDatasetZipFile,trainingDatasetFolder);
end
end
% Download test data set
testDatasetZipFile = matlab.internal.examples.downloadSupportFile('SPT','data/fetal-ecg-source-separation-testData.zip');
testDatasetFolder = fullfile(tempdir,'fetal-ecg-source-separation-testData');
if ~exist(testDatasetFolder,'dir')
unzip(testDatasetZipFile,testDatasetFolder);
end
Thank you very much for your answers!Have a nice day!

采纳的回答

Abhishek Kumar Singh
编辑:Abhishek Kumar Singh 2024-7-22
Hi @Yi Ma,
It seems that you're encountering an issue with downloading the dataset files using the matlab.internal.examples.downloadSupportFile function. This error might be due to a variety of reasons, including but bot limited to network issues.
If the automatic download is failing, you can manually download the files and place them in a folder of your choice (preferably anywhere except the temp directory, as writing permissions for MATLAB may have been disabled).
Here's the snippet you can use (replace tdir with a directory of your choice):
if trainNetworkFlag
% Manually download the training data set
trainingDatasetZipFile = fullfile(tdir, 'fetal-ecg-source-separation-trainingData.zip');
websave(trainingDatasetZipFile, 'https://ssd.mathworks.com/supportfiles/SPT/data/fetal-ecg-source-separation-trainingData.zip');
trainingDatasetFolder = fullfile(tdir, 'fetal-ecg-source-separation-trainingData');
if ~exist(trainingDatasetFolder, 'dir')
unzip(trainingDatasetZipFile, trainingDatasetFolder);
end
end
% Manually download the test data set
testDatasetZipFile = fullfile(tdir, 'fetal-ecg-source-separation-testData.zip');
websave(testDatasetZipFile, 'https://ssd.mathworks.com/supportfiles/SPT/data/fetal-ecg-source-separation-testData.zip');
testDatasetFolder = fullfile(tdir, 'fetal-ecg-source-separation-testData');
if ~exist(testDatasetFolder, 'dir')
unzip(testDatasetZipFile, testDatasetFolder);
end
As an ending note, please ensure you are using MATLAB release R2022b or later.
Hope it helps!

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Pattern Recognition and Classification 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by