how to approach a for loop problem where data needs to be saved automatically after taken?

1 次查看(过去 30 天)
i am working on this project where we are taking ecg and ppg signals from subjects. there will be three sets of data before the intake of green tea, three sets of data after thirty minutes of having green tea, three sets of data after sixty minutes of taking green tea. so each time we have to set the name of the data taken and manually save it. i am seeking for help on how to get started with the code where after the signal is taken it will ask the user if he wants to save it and the name of it on matlab. simple steps on getting started would be apprecciated!

回答(1 个)

Image Analyst
Image Analyst 2021-9-23
Here's snippet to save the name of a file to get you started:
% Get the name of the file that the user wants to save.
% Note, if you're saving an image you can use imsave() instead of uiputfile().
startingFolder = userpath % Or "pwd" or wherever you want.
defaultFileName = fullfile(startingFolder, '*.*');
[baseFileName, folder] = uiputfile(defaultFileName, 'Specify a file');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName)
  2 个评论
Image Analyst
Image Analyst 2021-9-24
It's well commented and explained. If you need further explanation of fullfile() and uiputfile() just see the documentation. I don't want to simply copy and paste their explanations in the help here when you can just simply look them up.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Files and Folders 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by