Shifting a graph without altering the data itself.

조회 수: 4 (최근 30일)
Yuval
Yuval 2016년 12월 22일
댓글: Star Strider 2016년 12월 22일
Hi, I have the following graph in which I'd like the two curves to coincide as closely as possible. Is there a way to achieve that without altering the data? Also, simply shifting the x data within the plot function by a certain offset (i.e. plot(x+offset,y)) doesn't yield the desired result.
Below is the plotting:
figure
subplot(2,1,1)
plot(k,RCS_PO,'k',k,RCS_MOM_soft,'m',k,RCS_MIE_soft,'b','LineWidth',2);

답변 (1개)

Star Strider
Star Strider 2016년 12월 22일
See the Signal Processing Toolbox alignsignals (link) function.
  댓글 수: 6
Yuval
Yuval 2016년 12월 22일
I am not looking for an exact alignment, only an adequate shift in the x axis.
Star Strider
Star Strider 2016년 12월 22일
For that, I would choose a subset of your data (for example 4 to 8 ka) and use the delay calculated from that. You would insert a zero or NaN vector the length of the delay returned as the third argument of alignsignals to your signal vector, and use linspace to extend your independent (probably time) vector to the appropriate length.

댓글을 달려면 로그인하십시오.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by