필터 지우기
필터 지우기

I want to plot ecg from the .mat file I have obtained after doing some preprocessing

조회 수: 26 (최근 30일)
The code is as below:
clc;
clear all;
close all;
ecg=load('train.mat');
f_s=300;
N=length(ecg)
t=[0:N-1]/f_s % time period(total sample/Fs )
figure, plot(t,ecg);
Kindly help me.

채택된 답변

Cris LaPierre
Cris LaPierre 2022년 12월 15일
편집: Cris LaPierre 2022년 12월 15일
You are loading your mat file variables into a structure you named ecg, so you must specify which variable in ecg to plot. Your data is stored in a variable called array. Additionally, array is a 5969x18000 array. Plotting almost 6,000 waveforms on the same figure is not an effective way to view this data. You will also likely get some warning messages trying to plot 107.5 million points. Consider plotting just one for now.
Each ECG waveform is stored in a row. Try this.
ecg=load('train.mat');
ecg1 = ecg.array(1,:);
f_s=300;
N=length(ecg1)
t=(0:N-1)/f_s; % time period(total sample/Fs )
figure
plot(t,ecg1);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by