How to stretch a 1-D signal over the axes

조회 수: 16 (최근 30일)
Ayesha
Ayesha 2014년 1월 31일
댓글: Ayesha 2014년 1월 31일
I basically want to compare the original signal with the output signal which has been shortened and hence I want to observe it after stretching it over the axes. For instance, the original signal goes from 0-500 and the output signal goes from 0-250. How would I stretch the output signal from 0-500 over the axes?

답변 (2개)

Amit
Amit 2014년 1월 31일
If you mean just making the limits same for both plots, you can just multiply the whole x-axis of your output signal with something like a factor :
factor = original_signal_x(end)/output_signal_x(end);

Walter Roberson
Walter Roberson 2014년 1월 31일
times1 = 0 : 500;
times2 = 0 : 250;
subplot(1,2,1);
plot(times1, original_signal, times2, shorter_signal);
title('without any stretching');
subplot(1,2,2);
plot(times1, original_signal, 2*times2, shorter_signal);
title('with stretching');
  댓글 수: 1
Ayesha
Ayesha 2014년 1월 31일
Error using plot Vectors must be the same lengths.

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

카테고리

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