필터 지우기
필터 지우기

how can I shift a discrete signal (in vector form) on the x axis?

조회 수: 1 (최근 30일)
Seba.V
Seba.V 2019년 8월 8일
편집: KALYAN ACHARJYA 2019년 8월 8일
By having the following graph how can i write a function to simulate the shift of the hole set of values to the left or the right of the graph?

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 8월 8일
편집: KALYAN ACHARJYA 2019년 8월 8일
What you are trying is unclear. Is this one? Anyways shiting the x values, you can do it multiple ways, here one way
function shift_plot()
n=input('Enter 1 for left or any other number for right ')
x_data=[1:0.5:10];
y_data=[10:-1:1];
if n==1
stem(x_data(1:10),y_data);
else
stem(x_data(end-9:end),y_data);
end
xlim([0 10]);
end
Command Window
Enter 1 for left or any other number for right 5
n =
5
>> shift_plot()
Enter 1 for left or any other number for right 1
n =
1

추가 답변 (1개)

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by