how to make a time shift function

조회 수: 3 (최근 30일)
Xkid Cabz
Xkid Cabz 2015년 11월 27일
편집: Walter Roberson 2015년 11월 27일
We were asked to create our own functions (m-file) like a general time shift function.
I'd imagine it like this but i ran into a problem on how would I shift the time.
function y = myTimeShift (X, shift, t)
% time shift function. X is a function of t given time (start:step:end).
????????????????? What is in here so that x(t) is now x(tshifted)?
in the command,
t = -5:0.1:5;
x = myStepfunc(1, t);
y = myTimeshift(x, -2, t);
plot (??,y);
The myStep function is from heaviside(t). only with changeable Amplitude A. see below.
function y = myStepfunc(A, t);
%Step function with Amplitde A, maximum time, and minimum time.
y=zeros(size(t));
y(t>0)= A;
y(t==0)=0.5;
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by