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

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 日
編集済み: 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!

1 件のコメント

Yi Ma
Yi Ma 2024 年 7 月 23 日
Thank you very much for your answer, it's fantastic! Have a great day!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDownloads についてさらに検索

質問済み:

2024 年 7 月 22 日

コメント済み:

2024 年 7 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by