how to make a time shift function

3 visualizzazioni (ultimi 30 giorni)
Xkid Cabz
Xkid Cabz il 27 Nov 2015
Modificato: Walter Roberson il 27 Nov 2015
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

Risposte (0)

Categorie

Scopri di più su Graph and Network Algorithms in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by