Unit Step Funtion Without using heaviside function
14 ビュー (過去 30 日間)
表示 古いコメント
How can I plot the u(t) = u(t-1)+u(t-2)+u(t-3)+u(t-4)-u(t+1)-u(t+2)-u(t+3)-u(t+4) ?
I would like to have the plot going up on both sides without using the heaviside func.
Thank you!
回答 (1 件)
Jonas
2022 年 6 月 21 日
編集済み: Jonas
2022 年 6 月 21 日
you could go over the integration of the delta function, which is the heaviside function:
t=-5:5;
ds=[0 1 1 1 1 0 -1 -1 -1 -1 0];
s=cumsum(ds);
stairs(t,s)
edit: ok, i think ds needs to be multiplied with -1:
ds=[0 -1 -1 -1 -1 0 1 1 1 1 0];
2 件のコメント
Jonas
2022 年 6 月 21 日
there may be no visual difference but the difference lies in the detail. Heaviside is defined as 0.5 at 0 and the cumsum version is already 1 there.
参考
カテゴリ
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!