필터 지우기
필터 지우기

draw pairwise line between each sample of two curves

조회 수: 6 (최근 30일)
tala
tala 2018년 6월 11일
댓글: tala 2018년 6월 11일
hello. I have two curves in a graph. how can i draw lines between each sample of curves. for example draw a line between sample 10 of curve 1 and between sample 10 of curve 2? both curves consist of 45 samples. and i want to draw line between each two corresponding samples. could anyone help me please?
s1: first signal
s2:second signal
figure; hold on;
plot(s1(:,1),s1(:,2),'.b-')
plot(s2(:,1),s2(:,2),'.r-')
grid;
%xlabel('time (s)');
%ylabel('amplitude (mV)');
title('Original disaligned waves');
pflag=1;
[dtw_Dist,D,dtw_k,w,s1w,s2w]=dtw(s1(:,1),s2(:,1),pflag);
dtw_Dist, dtw_k
the image attached is the figure consisting my two curves

채택된 답변

KSSV
KSSV 2018년 6월 11일
N = 10 ;
x = 1:N ;
S1 = [x' rand(N,1)] ;
S2 = [x' rand(N,1)+5] ;
figure
hold on
plot(S1(:,1), S1(:,2))
plot(S2(:,1), S2(:,2))
for i = 1:N
plot([S1(i,1) S2(i,1)],[S1(i,2) S2(i,2)])
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by