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

조회 수: 2 (최근 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
Fatematuz zahura
Fatematuz zahura 2021년 9월 24일
thank you so much. could you please explain the function of each line?
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에서 Communications Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by