if I use
ts = xlsread('ECGFiveDays_TRAIN.xlsx');
for i=1:23
p=ts(i,:)
fa = movstd(p,20,1);
secarray=movstd(fa,20,1)
k=maxk(secarray,10)
%figure(1)
%plot(p)
[~,ii] = min(abs(p(:) - k(:)'));
out = p(unique(ii));
%figure(2)
%plot(p)
%hold on;
%plot(cell2mat(arrayfun(@(x)find(abs(p-x)<eps),out, 'UniformOutput',false)), out,'*');
for iii=1:24
subSequence{1} = p(1:30);
subSequence{2} = p(31:60);
subSequence{3} = p(61:90);
subSequence{4} = p(91:120);
subSequence{5} = p(121:end);
end
A = [];
for ii = 1:length(subSequence)
if any(ismember(subSequence{ii},out))
A{end+1} = subSequence{ii};
aa = ii;
disp(aa);
end
end
end
Then how can I write all the subsequence into excel sheet .(that is write the subsequences contain in 1st row and next write the subsequences contain in the 2nd row in the 2nd row of excel).