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

2 visualizaciones (últimos 30 días)
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!

Respuestas (1)

Image Analyst
Image Analyst el 23 de Sept. de 2021
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 comentarios
Fatematuz zahura
Fatematuz zahura el 24 de Sept. de 2021
thank you so much. could you please explain the function of each line?
Image Analyst
Image Analyst el 24 de Sept. de 2021
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Communications Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by