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!