how to make a time shift function
조회 수: 3 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!