Saving and Loading ECG data (.mat)
11 views (last 30 days)
Show older comments
Sarfaraz Ahmed
on 26 Apr 2021
Commented: Sarfaraz Ahmed
on 27 Apr 2021
Hello. my query is when I load my ECG_Save variable, it does open saved ecg signal along with figure as well. I don't understand why figure open when I load ECG_Save variable ? I only want to see ECG_Save signal when I load it. it seems like figure also saved in ECG_Save data. how can I omit figure when I load data ?
I think I have some problem with this command in the below code : ECG_Save = ECG.Save;
The ECG code is :
while(ishandle(MainFigure_ECG))
ECGCrudeData = fscanf(Serialport, '%s');
ECG.Save(ECG.DataCursor) = str2double(ECGCrudeData);
end
save(['ECG_' datestr(now,30)]);
toc(For1sec)
close all
fclose(Serialport);
fclose(instrfind);
Anothe Script for loading and analyse ECG data: (here figue + ecg signal both shows -> I require only ecg signal here not figure)
load('ECG_20210426T224428.mat');
a=(ECG_Save(1,:));
figure;
plot(a);
0 Comments
Accepted Answer
Walter Roberson
on 26 Apr 2021
When you call save() and do not specify any variable names, then it will save all the variables in the current workspace. Including for example, the result of having called
MainFigure_ECG = figure(41);
You should avoid calling save() with no variable names, or else you should only do the save() from within a function that has a limited number of variables.
8 Comments
More Answers (0)
See Also
Categories
Find more on Data Import and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!