combining 2 ECG signal into 1
1 次查看(过去 30 天)
显示 更早的评论
I'm tring to merg 2 ECG signal into one (with same sampling rate), however, at the merging point, there is some error. I can't figure it out. could someone please help, appreciated. my code and the figure are attached.
clear all
close all
dataaf=load("AF2.mat"); % AF signal
xaf=dataaf.val(1,:);
xaf=detrend(xaf)';
datan=load("normal2.mat"); % Normal
xn=datan.val(1,:);
xn=detrend(xn)';
%xnr=resample(xn,250,128); % resample raw signal
xc=[xn;xaf];
Fs = 128;
t = (0:length(xc)-1)/Fs; %time value of any sample = [sample no./Fs]
plot(t,xc)
xlabel('Time [s]')
% hold on
pause
0 个评论
采纳的回答
Star Strider
2022-5-26
Unless the row vectors ‘xn’ and ‘xaf’ have the same number of elements, the vertical concatenation to produce ‘xc’ is going to fail:
xc=[xn;xaf];
Horizontrally concatenating them (note the substitution of the comma for the semicolon) however will work:
xc=[xn,xaf];
.
4 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Analog Filters 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!